6 Replies Latest reply on Jun 29, 2006 3:30 PM by marklittle

    Registering an XAResourceRecovery class

    paul.robinson

      Hello,

      I have an XAResource that is not serializable. I therefore need to implement an XAResourceRecovery class for the RecoveryManager to interrogate in order to obtain the prepared resources.

      I have placed the following property in the jbossjts-properties.xml:

      <property name="com.arjuna.ats.jta.recovery.XAResourceRecoveryFaulty" value="com.arjuna.xa.resources.FaultyXAResourceRecovery"/>


      I have tried placing it in the JTS, JTA and Arjuna sections of the properties file as I wasn't sure exctly where it should go. The documentation states that it should go "in the properties file". I assume I have the right properties file?

      I then run a transaction with 3 participants (all on the same JBoss instance). The second participant crashes when commit is called on it. I then reboot JBoss and my XAResourceRecovery class is not called. I would expect it to be called during the recovery cycle.

      Here is the output of the first recovery cycle that occurs when JBoss boots:

      10:20:56,645 INFO [arjLogger] Periodic recovery - second pass <Wed, 28 Jun 2006 10:20:56>
      10:20:56,645 INFO [arjLogger] AtomicActionRecoveryModule: Second pass
      10:20:56,646 INFO [txojLoggerI18N] [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_6] - TORecoveryModule - seco
      nd pass
      10:20:56,647 INFO [loggerI18N] [com.arjuna.ats.internal.jts.recovery.transactions.TopLevelTransactionRecoveryModule_4]
      [com.arjuna.ats.internal.jts.recovery.transactions.TopLevelTransactionRecoveryModule_4] - TopLevelTransactionRecoveryMod
      ule Second Pass
      10:20:56,648 INFO [logger] TransactionRecoveryModule.periodicWorkSecondPass()
      10:20:56,649 INFO [loggerI18N] [com.arjuna.ats.internal.jts.recovery.transactions.TransactionRecoveryModule_6] [com.arj
      una.ats.internal.jts.recovery.transactions.TransactionRecoveryModule_6] - Transaction -3f57f07c:84af:44a244b6:5b still i
      n ActionStore
      10:20:56,828 WARN [poa] POA RootPOA rid: 8 opname: _is_a _invoke: object id not previously generated!
      10:20:56,876 WARN [poa] POA RootPOA rid: 10 opname: _is_a _invoke: object id not previously generated!
      10:20:56,908 WARN [poa] POA RootPOA rid: 12 opname: _is_a _invoke: object id not previously generated!
      10:20:56,952 INFO [loggerI18N] [com.arjuna.ats.internal.jts.recovery.transactions.TransactionRecoveryModule_6] [com.arj
      una.ats.internal.jts.recovery.transactions.TransactionRecoveryModule_6] - Transaction -3f57f07c:80bf:44a2496a:28 still i
      n ActionStore
      10:20:56,970 WARN [poa] POA RootPOA rid: 16 opname: _is_a _invoke: object id not previously generated!
      10:20:56,973 WARN [poa] POA RootPOA rid: 14 opname: getCurrentStatus _invoke: object id not previously generated!
      10:20:57,006 INFO [loggerI18N] [com.arjuna.ats.internal.jts.recovery.transactions.ServerTransactionRecoveryModule_4] [c
      om.arjuna.ats.internal.jts.recovery.transactions.ServerTransactionRecoveryModule_4] - ServerTransactionRecoveryModule -
      Second Pass
      10:20:57,007 INFO [logger] JTS XARecoveryModule - second pass


      I am guessing that I have not put the property in the right place. However, I can't seem to find any more specific information on where this property should go.

      Any suggestions?

      Thanks,

      Paul.

        • 1. Re: Registering an XAResourceRecovery class
          paul.robinson

          In addition to my previous post, I have also tried placing the property in the "recoverymanager" section of the jbossjts-properties.xml file. I understand that this is the correct place to put this property?

          The XAResourceRecovery class is still not being called at recovery time.

          Paul.

          • 2. Re: Registering an XAResourceRecovery class
            marklittle

            In order to make sure the problem isn't with your application or installation, have you tried running the recovery examples that are in the wiki? If not, give them a go because we know they work.

            • 3. Re: Registering an XAResourceRecovery class
              paul.robinson

              From looking at the Wiki, I can only find examples of serializable XA resources. Is this correct, or are there some examples of XAResourceRecovery that I have missed?

              I have recovery of serializable XA resources working.

              Thanks,

              Paul.

              • 4. Re: Registering an XAResourceRecovery class
                marklittle

                You missed it. There's examples of non-serializable in there too. Unfortunately I can't check at the moment.

                • 5. Re: Registering an XAResourceRecovery class
                  paul.robinson

                  Hi,

                  Yes, you?re right, I did miss the examples. They are located on the following page: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossTSRecovery. There's a link to download the demo at the bottom of the page entitled "jtsrecovery.tar.gz".

                  I ran the above demo and the XAResourceRecovery class *is* called. I then replaced the XARecoveryResource and XAResource classes with my own and again the XAResourceRecovery class *is* called. I had to make some changes to my classes, but nothing fundamental to the recovery (I think!).

                  I then replaced my original XAResourceRecovery and XAResource classes with the ones that I had modified for the standalone demo. I then ran my original problem within JBoss. Again, the XAResourceRecovery class *is* called!

                  The only problem is that I don't know what I changed to make it work. I can only imagine that there was some problem with my XAResourceRecovery class and it wasn't been output to the console.

                  Anyway, it's working now, so I?m happy. I put the property (mentioned in my first post) in the "JTS" section of the jbossjts-properties.xml file. It doesn't work if you put it in the "recoverymanager" section.

                  Thanks for the help.

                  • 6. Re: Registering an XAResourceRecovery class
                    marklittle

                    Good to hear.