openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <>
Subject Re: Can entity manager join jdbc transaction?
Date Wed, 02 Jun 2010 19:49:15 GMT

You might consider turning this upside down and first starting a JPA  
transaction and then get the connection from OpenJPA to do your JDBC  
work. Then both JPA and your JDBC code would be working with the same  


On Jun 2, 2010, at 8:43 AM, Daryl Stultz wrote:

> Hello, my project has a lot of work done direct to JDBC and some new  
> work
> done through OpenJPA. I'm using 1.2.1 on Tomcat (non-container). I  
> have a
> situation where a JDBC connection is obtained and a transaction is  
> started.
> Then some OpenJPA querying is done. The Entity Manager obtains an
> independent connection which means it doesn't read the state with  
> respect to
> the JDBC transaction. Is there any way to get an Entity Manager to  
> join a
> JDBC transaction? My setup uses a DataSource to supply a connection  
> to the
> Entity Manager. It seems I could modify this to return the JDBC  
> connection,
> but I'm guessing the EM would close it before my JDBC operation is  
> done.
> Thanks.
> -- 
> Daryl Stultz
> _____________________________________
> 6 Degrees Software and Consulting, Inc.

Craig L Russell
Architect, Oracle
408 276-5638
P.S. A good JDO? O, Gasp!

View raw message