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

jaikiran pai do-not-reply at jboss.com
Fri Apr 9 13:47:57 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/536633#536633

--------------------------------------------------------------
> Andrig Miller wrote:
> 
> 
> So, I created two persistence units in my persistence.xml, with two different sets of Hibernate properties, pointing at the same database, and let it default to scanning for the Entities in my jar.
> 
I missed this earlier. So effectively, you are sharing the same entities between multiple entity managers. Do those entity managers really "share" those entities in your application? For example, if you try to access an entity which is shared (i.e. you access the entity using both the entity managers) then you will end up running into issues because each of these entity managers, that come from different entity manager factories, will (possibly) hold a different state.

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/536633#536633]

Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

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


More information about the jboss-user mailing list