XAER_RMERR during XA transaction recovery for Oracle database in JBoss EAP

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 4
    • 5
    • 6
    • 7
  • Oracle Database

Issue

The following message appears in the log intermittently (with the frequency configured for recovery) when XA recovery has been configured for an Oracle XA datasource:

14:55:40,069 WARN  [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException
    at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:703)
    at org.jboss.jca.adapters.jdbc.xa.XAManagedConnection.recover(XAManagedConnection.java:362)
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecoverySecondPass(XARecoveryModule.java:709) [jbossjts-jacorb-4.17.15.Final-redhat-4.jar:4.17.15.Final-redhat-4]
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.bottomUpRecovery(XARecoveryModule.java:431) [jbossjts-jacorb-4.17.15.Final-redhat-4.jar:4.17.15.Final-redhat-4]
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:212) [jbossjts-jacorb-4.17.15.Final-redhat-4.jar:4.17.15.Final-redhat-4]
    at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:789) [jbossjts-jacorb-4.17.15.Final-redhat-4.jar:4.17.15.Final-redhat-4]
    at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-jacorb-4.17.15.Final-redhat-4.jar:4.17.15.Final-redhat-4]

Resolution

Configure Oracle to allow the user access to the tables necessary for XA recovery.  If Oracle 10g R2 with patch for bug 5945463 or 11g (or later) are in use then grant these permissions:

  GRANT SELECT ON sys.dba_pending_transactions TO <user>;
  GRANT SELECT ON sys.pending_trans$ TO <user>;
  GRANT SELECT ON sys.dba_2pc_pending TO <user>;
  GRANT EXECUTE ON sys.dbms_xa TO <user>;
  GRANT FORCE ANY TRANSACTION TO <user>;

Where <user> is the user defined to connect from JBoss to Oracle.

If an unpatched version prior to 11g is used, grant these permissions (the difference is the GRANT EXECUTE query):

  GRANT SELECT ON sys.dba_pending_transactions TO <user>;
  GRANT SELECT ON sys.pending_trans$ TO <user>;
  GRANT SELECT ON sys.dba_2pc_pending TO <user>;
  GRANT EXECUTE ON sys.dbms_system TO <user>;
  GRANT FORCE ANY TRANSACTION TO <user>;

In some cases it may also be necessary to manually run the Oracle script xaview.sql as noted in:

For definitive requirements on what is needed for Oracle please consult the Oracle documentation.

Important notes:

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.