JBoss Community

Re: Why do EJBs share EntityManager instances

created by Kieran Simpson in EJB3 - View the full discussion

Doing some further digging around, the object that is being injected  into the DAOs is an instance of org.jboss.jpa.tx.TransactionScopedEntityManager which is located in the jboss-as/common/lib/jboss-jpa-deployers.jar  JAR.  Looking inside the manifest, the JAR is at version 1.0.0

 

Looking at the source, it would appear as if the TSEM  class should be doing what I thought it should do; that is provide  EntityManagers which are only enrolled in the transaction that is  currently assigned to the thread.

 

Still I have no idea  why when a transaction is rolled back in one thread all transactions are  rolled back.  Perhaps this is a transaction management issue rather  than an EntityManager problem.

Reply to this message by going to Community

Start a new discussion in EJB3 at Community