[hibernate-dev] JdbcSession proposal
Scott Marlow
smarlow at redhat.com
Tue Jun 24 22:23:00 EDT 2014
I pushed a test case that simulates what can happen with remote EJB
invocations that share the same JTA transaction & EntityManager. The
"Transaction was rolled back in a different thread!" error [2] is thrown
but shouldn't be, since the active application thread has changed to a
different thread (which can happen). The workaround is to set
"hibernate.jta.track_by_thread" to false.
I think that we need to save the thread id at the start of every
application call into the EntityManager.
Scott
[1] https://github.com/scottmarlow/hibernate-orm/tree/sametx_multithreads
[2] https://gist.github.com/scottmarlow/63c4ab686368853d759b
More information about the hibernate-dev
mailing list