mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@411832 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a4bb58725d
commit
7976ad976e
|
@ -104,7 +104,6 @@ public class TransactionContext {
|
|||
public void close() throws IOException {
|
||||
if( !inTx ) {
|
||||
try {
|
||||
executeBatch();
|
||||
|
||||
/**
|
||||
* we are not in a transaction so should not be committing ??
|
||||
|
@ -115,7 +114,7 @@ public class TransactionContext {
|
|||
try{
|
||||
executeBatch();
|
||||
} finally {
|
||||
if (connection != null) {
|
||||
if (connection != null && !connection.getAutoCommit()) {
|
||||
connection.commit();
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +148,8 @@ public class TransactionContext {
|
|||
throw new IOException("Not started.");
|
||||
try {
|
||||
executeBatch();
|
||||
connection.commit();
|
||||
if( !connection.getAutoCommit() )
|
||||
connection.commit();
|
||||
} catch (SQLException e) {
|
||||
JDBCPersistenceAdapter.log("Commit failed: ", e);
|
||||
throw IOExceptionSupport.create(e);
|
||||
|
|
Loading…
Reference in New Issue