Customer is working on JBoss AMQ 6.1.0, and configured below persistenceAdapter in activemq.xml
-----------------------------------------------------------------------------------------------------
<persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#oracle-ds" useDatabaseLock="true" lockKeepAlivePeriod="2000" >
<locker>
<lease-database-locker lockAcquireSleepInterval="30000"/>
</locker>
</jdbcPersistenceAdapter>
</persistenceAdapter>
-----------------------------------------------------------------------------------------------------
and facing the below error :
2017-12-06 00:27:45,859 | WARN | JDBC Failure: ORA-08103: object no longer exists
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter | main java.sql.SQLException: ORA-08103: object no longer exists |
He has the following query :
-----------------------------------------------------------------------------------------------------
ACTIVEMQ_ACKS has a primary key constraint, which is implemented as unique index on the table. If an AMQ instance is master it will query the table. Oracle creates for the query an execution plan based on the index, which will be reused.
If there is a failover of the master to another AMQ instance it looks like AMQ is dropping and re-creating the primary key constraint on ACTIVEMQ_ACKS,
If one of the AMQ instances executes a select on ACTIVEMQ_ACKS again and Oracle decides to reuse the existing execution plan, based on the dropped index, an ORA-08103 error will be thrown. We think this happens with even a higher probability if the master bounces back and forth between the nodes
Thus our question is the following :
Why does AMQ drop and re-create the primary key index?
-----------------------------------------------------------------------------------------------------
Actually, the issue is sporadic at their end and I am not able to recreate it in my environment.
The drop and recreate is a way to modify the index to add new values, but in production it is a bad idea or bug.
Attached the full configuration file and logs provided by customer