Search code examples
oraclehibernatejdbcjta

How to disable Bitronix JTA recovery


I'm facing the following exception when a connection is acquired from Oracle:

javax.transaction.xa.XAException
    at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:705)
    at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:103)
    at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:61)
    at bitronix.tm.recovery.IncrementalRecoverer.recover(IncrementalRecoverer.java:64)
    at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:106)
    at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:97)
    at bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:207)
    at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:71)
    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
    at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
    at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
    at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
    at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
    at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:60)
    at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.enlistInCurrentTransaction(ExtendedEntityManagerCreator.java:421)
    at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:398)
    at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:350)
    at $Proxy48.joinTransaction(Unknown Source)
    at org.springframework.orm.jpa.EntityManagerFactoryUtils.doGetTransactionalEntityManager(EntityManagerFactoryUtils.java:174)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:211)
    at $Proxy48.getDelegate(Unknown Source)

As described here and here OracleXAResource.recover() requires some grants. I don't need recovery, and do not like to apply those oracle settings so I want to disable Bitronix recovery. I found nothing related in Bitronix Configuration docs, so I want to ask here if this is possible to disabled Bitronix recovery feature?


Solution

  • If you are using XA you need recovery, it is part of the XA protocol. Not implementing recovery for XA would violate the XA protocol. Are you sure you really understand the implications? Otherwise you need a different protocol.