I know we're not supposed to be quick to assume there are bugs in Hibernate, and I'm no exception as this is my first time using the actual Hibernate Session (have been using JPA Entity Manager until now). I'm doing some testing with batching and I'm getting a NullPointerException within the Hibernate 3.3.1 code. I create 30 persistent objects and iterate calling session.save() for each one. I can see within the debugger that Cascade.java (line 378) invokes the following method with an explicit "null" value for the Set parameter.
Code:
eventSource.delete( entityName, orphan, false, null );
Then the stack gets to DefaultDeleteEventListener (line 205) and attempts to invoke a method on the set that was passed in null.
Code:
if ( transientEntities.contains( entity ) ) {
This is where the NPE occurs. Why is there no exception handling here?
Also, I would prefer to just stick with JPA here, but I was unable to find a JPA equivalent to session.setCacheMode(CacheMode.IGNORE), is there something like this? Does JPA simply not support batching like Hibernate?
Thanks!