[jboss-user] [EJB 3.0] - Multiple Persistence Units with the same entities

jaikiran pai do-not-reply at jboss.com
Fri Apr 9 13:37:41 EDT 2010

jaikiran pai [http://community.jboss.org/people/jaikiran] replied to the discussion

"Multiple Persistence Units with the same entities"

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

> Andrig Miller wrote:
> In the batch processing methods I use the entity manager that is configured for batch processing, and in the other methods I use the one configured for OLTP processing.
> This is all working, but when I was reading various sources for whether this "should" work, it wasn't clear.
> So, while it does work, what I am wondering, is this spec compliant, or is this just dumb, blind luck that it works?
It's definitely +not+ luck  :)  I don't see anything wrong in what you are doing.

One thing that you might want to keep note is to make sure that  you don't end up using both those entity managers  in the same transaction - in which case you would be enrolling 2 transaction aware resources (the datasource corresponding to the entity managers) in one transaction. You would then require XA datasources for such cases.


Reply to this message by going to Community

Start a new discussion in EJB 3.0 at Community

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

More information about the jboss-user mailing list