Thanks for the report! Here the fix: https://issues.apache.org/jira/browse/TOMEE-720
Using commons dbcp instead of tomcat jdbc you shouldn't get this behavior *Romain Manni-Bucau* *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/1/10 diuis <[email protected]> > Hi Romain, > Hi all, > finally I wrote a little sample to reproduce the strange JPA behavior. > > Please, download it from github: > > git clone https://github.com/diuis/test-jpa-tx.git > > change directory: > > cd test-jpa-tx/ > > and run TomEE 1.5.1: > > mvn package tomee:run > > I wrote a simple REST service; you could open these urls: > > http://localhost:8080/test-jpa-tx-0.0.1-SNAPSHOT/start/tx1 > The 'tx1 service' open a connection to the first persistence unit (PUBLIC > is > the CATALOG and sa1 the username). > > http://localhost:8080/test-jpa-tx-0.0.1-SNAPSHOT/start/tx2 > The 'tx2 service' open a connection to the second persistence unit (PUBLIC > is the CATALOG and sa2 the username). > > http://localhost:8080/test-jpa-tx-0.0.1-SNAPSHOT/start/tx > The 'tx service' uses both the persistence units, but first, in the same > ejb > transaction, and after in two different transactions. > When the transaction is the same, I guess that the second entity manager > takes the already opened db connection, instead of the connection of the > datasource configured in the persistence.xml. > > I have not used the XA jdbc driver in this test, but I used it in my real > application, where I have two different databases (MySQL and H2) and the > result is the same. > > Thank for the support, > Demis Gallisto > > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/TomEE-1-5-1-SNAPSHOT-strange-JPA-behavior-tp4658500p4660225.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
