mirror of
https://github.com/apache/activemq.git
synced 2025-02-12 21:16:06 +00:00
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/branches/activemq-4.0@411847 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
718fd30de2
commit
1774120827
@ -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…
x
Reference in New Issue
Block a user