You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/06/05 17:51:35 UTC
svn commit: r411832 -
/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
Author: chirino
Date: Mon Jun 5 08:51:35 2006
New Revision: 411832
URL: http://svn.apache.org/viewvc?rev=411832&view=rev
Log:
Applied http://issues.apache.org/activemq/browse/AMQ-711
Modified:
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java?rev=411832&r1=411831&r2=411832&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java Mon Jun 5 08:51:35 2006
@@ -104,7 +104,6 @@
public void close() throws IOException {
if( !inTx ) {
try {
- executeBatch();
/**
* we are not in a transaction so should not be committing ??
@@ -115,7 +114,7 @@
try{
executeBatch();
} finally {
- if (connection != null) {
+ if (connection != null && !connection.getAutoCommit()) {
connection.commit();
}
}
@@ -149,7 +148,8 @@
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);