git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@411832 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-06-05 15:51:35 +00:00
parent a4bb58725d
commit 7976ad976e
1 changed files with 3 additions and 3 deletions

View File

@ -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);