|
Hibernate version: 3.0
Hi, we are using a long lived session and managing our own transactions to maintain a conversation over multiple transactions. What we are trying to do is to make our transaction rollback handling code get the Hibernate session cache back in sync after a rollback.
The scenario is that we create a new hibernate pojo and then something after that causes that unit of work to fail so we get the Transaction from the session and issue a rollback. We then, for each pojo touched within that unit of work, use the evict method to remove it from Hibernate.
However in the subsequent transaction's commit (this time without it rolling back) we get the "possible nonthreadsafe access to session" assertion failure from the EntityInsertAction class.
It appears that the insert action from the previous rolled back transaction is still in the ActionQueue, and because we have evicted the pojo that the EntityInsertAction refers to this assertion is triggered (Its assuming that a different thread has deleted that pojo I guess - but it hasn't, we've just evicted it).
Shouldn't the evict() method clean up any references to that evicted pojo from the ActionQueue or am I missing something here?
many thanks,
Mike
_________________ Michael Hurd
Software Engineer
Nexagent LTD
|