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
This commit is contained in:
Hiram R. Chirino 2008-08-15 15:54:57 +00:00
parent 15fb25d653
commit 479f5e1713
1 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,15 @@ public class MySqlJDBCAdapter extends DefaultJDBCAdapter {
public void setStatements(Statements statements) { public void setStatements(Statements statements) {
statements.setLockCreateStatement("LOCK TABLE " + statements.getFullLockTableName() + " WRITE"); statements.setLockCreateStatement("LOCK TABLE " + statements.getFullLockTableName() + " WRITE");
statements.setBinaryDataType("LONGBLOB"); 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); super.setStatements(statements);
} }
} }