You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2006/01/27 11:16:22 UTC
svn commit: r372805 -
/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
Author: jstrachan
Date: Fri Jan 27 02:16:16 2006
New Revision: 372805
URL: http://svn.apache.org/viewcvs?rev=372805&view=rev
Log:
added fix for issue reported on forum: http://forums.activemq.org/posts/list/0/60.page
where on startup we get the following exception when using mysql
java.io.IOException: Can't call commit when autocommit=true
at org.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:44)
at org.activemq.store.jdbc.TransactionContext.close(TransactionContext.java:113)
at org.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPersistenceAdapter.java:253)
at org.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceAdapter.java:140)
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/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java?rev=372805&r1=372804&r2=372805&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 Fri Jan 27 02:16:16 2006
@@ -100,6 +100,10 @@
public void close() throws IOException {
if( !inTx ) {
try {
+ executeBatch();
+
+ /**
+ * we are not in a transaction so should not be committing
try{
executeBatch();
} finally {
@@ -107,6 +111,7 @@
connection.commit();
}
}
+ */
} catch (SQLException e) {
throw IOExceptionSupport.create(e);
} finally {