You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Julian Graham <jo...@gmail.com> on 2009/05/01 01:13:19 UTC

Re: connection leak after sql exception

Hi all,

Actually after some concerted debugging and digging around in the
code, it looks like this is actually a problem with Spring
Transactions, Glassfish, or a combination of the two: When Spring's
JtaTransactionManager has direct access to the UserTransaction, for
some reason it fails to notify OpenJPA's EntityManager when a
transaction has been rolled back.  Forcing Spring's transaction
manager to interact with the appserver's transactions via the JTA
TransactionManager instead seems to resolve this (FWIW, the fix is to
set JtaTransactionManager's "autodetectUserTransaction" property to
false).


Regards,
Julian

Re: connection leak after sql exception

Posted by Rick Curtis <cu...@gmail.com>.
Good to hear you figured out what was going on! I dug through the code/tested
yesterday and didn't see anywhere that OpenJPA would leak a connection. 

-Rick


Julian Graham wrote:
> 
> Hi all,
> 
> Actually after some concerted debugging and digging around in the
> code, it looks like this is actually a problem with Spring
> Transactions, Glassfish, or a combination of the two: When Spring's
> JtaTransactionManager has direct access to the UserTransaction, for
> some reason it fails to notify OpenJPA's EntityManager when a
> transaction has been rolled back.  Forcing Spring's transaction
> manager to interact with the appserver's transactions via the JTA
> TransactionManager instead seems to resolve this (FWIW, the fix is to
> set JtaTransactionManager's "autodetectUserTransaction" property to
> false).
> 
> 
> Regards,
> Julian
> 
> 

-- 
View this message in context: http://n2.nabble.com/connection-leak-after-sql-exception-tp2695171p2753216.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.