从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)
如上所述here和here OracleXAResource.recover()需要一些授权。我不需要恢复,也不喜欢应用那些oracle设置,所以我想禁用Bitronix恢复。我在Bitronix Configuration docs中找不到任何相关内容,所以我想问一下这是否可以禁用Bitronix恢复功能?
答案 0 :(得分:3)
如果您正在使用XA,则需要恢复,它是XA协议的一部分。不实施XA恢复会违反XA协议。你确定你真的了解其含义吗?否则你需要一个不同的协议。