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&...]