LDAP-179: DataSource connections not being released when LDAP connection fails in JDBC integrated transaction.
Now cleaning up in DataSource and Hibernate transaction managers in doBegin if failing to create LDAP transaction.
This commit is contained in:
@@ -77,8 +77,14 @@ public class ContextSourceAndDataSourceTransactionManager extends
|
||||
|
||||
super.doBegin(actualTransactionObject.getDataSourceTransactionObject(),
|
||||
definition);
|
||||
ldapManagerDelegate.doBegin(actualTransactionObject
|
||||
.getLdapTransactionObject(), definition);
|
||||
try {
|
||||
ldapManagerDelegate.doBegin(actualTransactionObject
|
||||
.getLdapTransactionObject(), definition);
|
||||
} catch (TransactionException e) {
|
||||
// Failed to start LDAP transaction - make sure we clean up properly
|
||||
super.doCleanupAfterCompletion(actualTransactionObject.getDataSourceTransactionObject());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -76,8 +76,14 @@ public class ContextSourceAndHibernateTransactionManager extends HibernateTransa
|
||||
|
||||
super.doBegin(actualTransactionObject.getHibernateTransactionObject(),
|
||||
definition);
|
||||
ldapManagerDelegate.doBegin(actualTransactionObject
|
||||
.getLdapTransactionObject(), definition);
|
||||
try {
|
||||
ldapManagerDelegate.doBegin(actualTransactionObject
|
||||
.getLdapTransactionObject(), definition);
|
||||
} catch (TransactionException e) {
|
||||
// Failed to start LDAP transaction - make sure we clean up properly
|
||||
super.doCleanupAfterCompletion(actualTransactionObject.getHibernateTransactionObject());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user