AnsweredAssumed Answered

MyBatis Multi-db vendor support

Question asked by balsarori on Mar 13, 2015
Latest reply on Mar 16, 2015 by balsarori
An old post asking to upgrade to MyBatis 3.1.x to take advantage of MultiVendor database support

MyBatis 3.2.5 is currently used in Activiti.

Using MyBatis Multi-db vendor support and other simple tweaks which included

  • Postgres specific statements were removed instead a property bolbType was used in original statements
  • db2 and mssql required especial handling with native statements. All Native statements now use selectByNativeQuery
  • removed statements ending with _integerBoolean (required by oracle, db2, and mssql) a property boolValue was used instead
  • DB specific statements (i.e. that used to end with _mysql, _oracle) now hold the same statement id but with corresponding databaseId attribute value
Over 40 statements were removed. Additionally, only configured database specific statements and properties are loaded when the engine starts.

I removed all database vendor specific statements remapping from the org.activiti.engine.impl.db.DbSqlSessionFactory class and externalized databaseSpecificLimitXXX and other properties to files.

However, I didn't make a pull request since I wasn't able to test all use cases and databases. Any help testing the code will be appreciated.