Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTM and Oracle XA database links #47

Closed
krokodylowy opened this issue Aug 1, 2015 · 1 comment
Closed

BTM and Oracle XA database links #47

krokodylowy opened this issue Aug 1, 2015 · 1 comment

Comments

@krokodylowy
Copy link

Hi
We got app based on Oracle+BTM+SpringFramerwotk+Hibernate
and I see resource leak if XA transaction contain operation on database links.
Resurces are released on application kill.

I know. this is common problem http://stackoverflow.com/questions/5088934/how-can-i-close-oracle-dblinks-in-jdbc-with-xa-datasources-and-transactions-to-a
but how to add additional action 'alter session close database link ' after transaction commit /rollback

@lorban
Copy link
Contributor

lorban commented Aug 1, 2015

You could register a synchronization (http://docs.oracle.com/javaee/5/api/javax/transaction/Synchronization.html) in the current transaction that would execute the alter session query in the afterCompletion() method.

Now the way to get the current transaction in which you can register the synchronization and a jdbc connection to run the query highly depends on your spring/hibernate stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants