I’m using Hibernate 4.1.8.Final/Spring 3.1 and getting the following exception:
java.lang.NullPointerException
at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushin$
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(Abstract$
at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventLis$
at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1185)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1240)
It may be an open bug in Hibernate 4.1.8 Core.
Here is a JIRA issue HHH-7821: https://hibernate.onjira.com/browse/HHH-7821.
It appears that the bug reporter began seeing it sporadically after upgrading from 4.1.6 to 4.1.8. The reporter mentioned that it is an involved application, and is trying to get an isolated recreatable scenario.
I don’t know if this is the same scenario as yours (as all you posted was a Stacktrace), but you may wish to look at that (and other referenced JIRA HHH-7829) and if it is related, comment/monitor progress on those open JIRA Issues.