title: Hibernate AssertionFailure in different Threads
body: <p>I connect to my database with one session. I have always the same session in my whole program. My Thread "1" catches primary data from the database. The user must be allowed to cancel this thread. So if the user presses the cancel button to often or to fast (this is my interpretation) the following error occures:</p>
  
  <pre><code>ERROR org.hibernate.AssertionFailure - HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) 
  org.hibernate.AssertionFailure: possible non-threadsafe access to the session
  </code></pre>
  
  <p>The same errors occures if i cancel my thread "2" which is running in the background after my thread "1" ist finished and the try to load another primary data set from the database.</p>
  
  <p>Is the failure that i am using the same session in my two threads?</p>
  
  <p>What is the right way to solve such a problem?</p>