Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
5.8.0
-
None
Description
When a jdbcPersistenceAdapter is configured using the "adapter" attribute (as below), the tablePrefix specified in the statements element is ignored during table creation.
<jdbcPersistenceAdapter createTablesOnStartup="true" dataSource="#mysql-ds" adapter="#sybase-adapter" useDatabaseLock="true"> <statements> <statements tablePrefix="myprefix_"/> </statements> </jdbcPersistenceAdapter> ..... <bean id="sybase-adapter" class="org.apache.activemq.store.jdbc.adapter.SybaseJDBCAdapter"/>
It seems spring is calling the org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.setAdapter() method before org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.setStatements() is called. The setAdapter() triggers the table creation - hence no *tablePrefix" is used.
This problems can be worked around if the adapter is configured as an element (as below) however this isn't the most ideal fix.
<persistenceAdapter>
<jdbcPersistenceAdapter>
<statements>
<statements tablePrefix="myprefix_"/>
</statements>
<adapter>
<sybase-jdbc-adapter/>
</adapter>
</jdbcPersistenceAdapter>
</persistenceAdapter>
Attachments
Issue Links
- is duplicated by
-
AMQ-4382 jdbcPersistenceAdapter does not use lockCreateStatement value
- Closed