title: Hibernate NullPointerException in Query.list()
body: <p>It was reproduced only once with following stacktrace</p>
  
  <blockquote>
    <p>Caused by: java.lang.NullPointerException
          at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:119)
          at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
          at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
          at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:970)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1115)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)</p>
  </blockquote>
  
  <p>Anyone has idea what can be reason?</p>
  
  <p>Hibernate version is 3.2.7.GA </p>
  
  <p>I am sure that reason is not in current query, for each list execute. Why can flush for current session fall? Is it can be prevented somehow?</p>