activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r411832 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
Date Mon, 05 Jun 2006 15:51:35 GMT
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);



Mime
View raw message