[jboss-user] [EJB3] - Re: Why do EJBs share EntityManager instances

Kieran Simpson do-not-reply at jboss.com
Mon Dec 13 21:59:56 EST 2010

Kieran Simpson [http://community.jboss.org/people/kierans] created the discussion

"Re: Why do EJBs share EntityManager instances"

To view the discussion, visit: http://community.jboss.org/message/575802#575802

Doing some further digging around, the object that is being injected  into the DAOs is an instance of  http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.jboss.jpa/jboss-jpa-deployers/1.0.0/org/jboss/jpa/tx/TransactionScopedEntityManager.java#TransactionScopedEntityManager.getEntityManager%28%29 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20101213/b872cc03/attachment.html 

More information about the jboss-user mailing list