4 Replies Latest reply on Aug 17, 2009 6:43 PM by kukeltje

    prepare failed with exception XAException.XAER_RMFAIL??

    gan.gary

      I have a JBoss server running .
      while it's running test, it hit these error msg:

      ...[com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] XAResourceRecord.prepare - prepare failed with exception XAException.XAER_RMFAIL
      ...[com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_50] - Prepare phase of action acc434c:9ca:491d40e8:23aef7 received heuristic decision: TwoPhaseOutcome.HEURISTIC_HAZARD
      ...[com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_36] - BasicAction.End() - prepare phase of action-id acc434c:9ca:491d40e8:23aef7 failed.
      ...[com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_37] - Received heuristic: TwoPhaseOutcome.HEURISTIC_HAZARD .
      ...[com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_38] - Action Aborting
      ...ERROR [org.jboss.resource.adapter.jms.inflow.JmsServerSession] org.jboss.resource.adapter.jms.inflow.JmsServerSession@49f9fa failed to commit/rollback
      javax.transaction.HeuristicMixedException
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1397)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsServerSession.java:494)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
       at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
       at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:761)
       at java.lang.Thread.run(Thread.java:595)


      Seems like this txn is partially commited. What could be the root? How to solve?

        • 1. Re: prepare failed with exception XAException.XAER_RMFAIL??
          gan.gary

          anyone?

          • 2. Re: prepare failed with exception XAException.XAER_RMFAIL??
            gan.gary

            anyone?

            • 3. Re: prepare failed with exception XAException.XAER_RMFAIL??

              Hello gan.gary,

              I ran into this issue several days ago using the PGXADataSource; so, depending on your setup, this solution may provide some insight.

              The issue arose from within Postgres: the default install only provided 5 prepared transactions and JBoss was trying to use more. When the transaction manager attempted to prepare a new transaction, it would fail with XAER_RMFAIL. No other exceptions or errors were logged and no real hints at the root cause were given (even with trace logging).

              However, Postgres was logging errors in its own log:

              ERROR: maximum number of prepared transactions reached
              HINT: Increase max_prepared_transactions (currently 5).
              


              Increasing the number of prepared transactions resolved the issue (at the cost of more shared memory). Postgres' website suggests "...you will probably want max_prepared_transactions to be at least as large as max_connections, to avoid unwanted failures at the prepare step." (source: http://www.postgresql.org/docs/8.1/static/runtime-config-resource.html)

              Hopefully this solves your problems or points you in the right direction.

              Regards,

              Richard Burnison

              • 4. Re: prepare failed with exception XAException.XAER_RMFAIL??
                kukeltje

                @Richard,

                Thank you so much. I totally forgot to look in the DBMS (normally the DBA does those things). It helped me get one step further.