From 479f5e1713282f652f9eb7d9fe5a34edad058c9d Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Fri, 15 Aug 2008 15:54:57 +0000 Subject: [PATCH] Fix for MySQL DB tables should be INNODB based for proper tx support: https://issues.apache.org/activemq/browse/AMQ-1891 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@686264 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/store/jdbc/adapter/MySqlJDBCAdapter.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java index a5acdd332d..ba514a0f82 100644 --- a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java @@ -27,6 +27,15 @@ public class MySqlJDBCAdapter extends DefaultJDBCAdapter { public void setStatements(Statements statements) { statements.setLockCreateStatement("LOCK TABLE " + statements.getFullLockTableName() + " WRITE"); statements.setBinaryDataType("LONGBLOB"); + + // Use INNODB table since we need transaction support. + String[] s = statements.getCreateSchemaStatements(); + for (int i = 0; i < s.length; i++) { + if( s[i].startsWith("CREATE TABLE")) { + s[i] = s[i]+" TYPE=INNODB"; + } + } + super.setStatements(statements); } }