mirror of https://github.com/apache/activemq.git
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) git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@372805 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8fbbd24122
commit
2f944a19e3
|
@ -100,6 +100,10 @@ public class TransactionContext {
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
if( !inTx ) {
|
if( !inTx ) {
|
||||||
try {
|
try {
|
||||||
|
executeBatch();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* we are not in a transaction so should not be committing
|
||||||
try{
|
try{
|
||||||
executeBatch();
|
executeBatch();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -107,6 +111,7 @@ public class TransactionContext {
|
||||||
connection.commit();
|
connection.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw IOExceptionSupport.create(e);
|
throw IOExceptionSupport.create(e);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue