This question is originated from the drools-jpa-persistence package. An application-scoped entitymanager (singleton) is shared by all clients. When the entitymanager joins a JTA transaction in one thread, before that transaction ends, it may be invoked on entityManager.joinTransaction() in another thread for a different JTA transaction. My question is how Hibernate session reacts to the joinTransaction() method call. I would expect it suspends the 2nd thread till the 1st transaction ends. Please shed some lights. Many thanks.
|