openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: How to find entity belong which EntityManger?
Date Wed, 15 Jun 2011 16:27:13 GMT
> do you know why it is happening?
Do not know enough on how or where you are using this double-em solution to
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

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

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message