Consistent reset of resource holders on doBegin failure
Issue: SPR-12280
(cherry picked from commit 9758bc7)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -124,7 +124,7 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
||||
protected Object doGetTransaction() {
|
||||
CciLocalTransactionObject txObject = new CciLocalTransactionObject();
|
||||
ConnectionHolder conHolder =
|
||||
(ConnectionHolder) TransactionSynchronizationManager.getResource(getConnectionFactory());
|
||||
(ConnectionHolder) TransactionSynchronizationManager.getResource(getConnectionFactory());
|
||||
txObject.setConnectionHolder(conHolder);
|
||||
return txObject;
|
||||
}
|
||||
@@ -157,7 +157,6 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
||||
}
|
||||
TransactionSynchronizationManager.bindResource(getConnectionFactory(), txObject.getConnectionHolder());
|
||||
}
|
||||
|
||||
catch (NotSupportedException ex) {
|
||||
ConnectionFactoryUtils.releaseConnection(con, getConnectionFactory());
|
||||
throw new CannotCreateTransactionException("CCI Connection does not support local transactions", ex);
|
||||
@@ -266,7 +265,7 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
||||
}
|
||||
|
||||
public ConnectionHolder getConnectionHolder() {
|
||||
return connectionHolder;
|
||||
return this.connectionHolder;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user