openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: How to find entity belong which EntityManger?
Date Wed, 15 Jun 2011 16:27:13 GMT
Hi,
> do you know why it is happening?
Do not know enough on how or where you are using this double-em solution to
comment. 
A sanity check of this sort might help

Metamodel m1 = emDB2.getMetamodel();
Metamodel m2 = emSS.getMetamodel();
assertNotSame(m1, m2);

Set&lt;EntityType&lt;?&gt;> types1 = m1.getEntities();
Set&lt;EntityType&lt;?&gt;> types2 = m2.getEntities();

// verify two sets are *either* dis-joint or at least their difference is
non-empty.

> so that we can achieve XA transaction?
The fact that 
a) your units are JTA 
and you are in a container environment, 
*should* make both the transactions from two ems join the 'global
transaction' managed by the container. 

If you do not see that is happening, see the facility EntityManager.join()
to join a transaction. 

-----
Pinaki 
--
View this message in context: http://openjpa.208410.n2.nabble.com/How-to-find-entity-belong-which-EntityManger-tp6470903p6479579.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message