6 Replies Latest reply on May 18, 2006 11:41 AM by Mark Little

    RecoveryManager and TransactionManager

    mskonda Apprentice

      I have a scenario where I am running a test client with two XAResources. My test client fails before commiting (actually during prepare state) leaving the transactions in doubt. (The tests are standalone and hence the Objectstore is created under the same directory as the tests -which is expected). The failed transactions are logged to the object store.

      I start my RecoveryManager and try to do a recovery - howerver failed trascations arent't processed. I used both DIRECT and INDIRECT mechnisms by instnatiating the RecoveryManager as a seperate process (I tried instantiating the RecoveryManager in the same process as test client but didn't gain anything).

      Am I missing any configuration bits (such as port on which it is listening to etc - infact I have set the recoveryPort attribute too)? As I am instatiating the RecoveryManager from the same directory, I am guessign it'll read the object store from there.

      Any pointers much appreciated

      Thanks
      Madhu

        • 1. Re: RecoveryManager and TransactionManager
          Mark Little Master

          You don't say which version of JBossTS you are using? Is it local JTA or JTS?

          • 2. Re: RecoveryManager and TransactionManager
            mskonda Apprentice

            It's localJTA mark.

            Thanks
            Madhu

            • 3. Re: RecoveryManager and TransactionManager
              Mark Little Master

              First you need to make sure you've got the local JTS XARecoveryModule in place (the one in the arjunacore package). You can remove the XARecoveryModule in the jts package.

              The recovery manager will look for the object store in wherever you've set it in your jbossjts-properties.xml (which is searched for in the cwd and your classpath). If you don't change the default setting in there (or the system can't find the property file), then it'll default to cwd and be called PutObjectStoreDirHere. Can you confirm that this is the case?

              Next, do you actually have any entries in the object store to recover? You say that the failure happens during prepare. In that case it depends where in prepare, because the transaction system will only write the log entry once all of the participants have successfully prepared. Failures before that will cause the transaction to roll back so there will be no recovery.

              OK, that should do for now.

              • 4. Re: RecoveryManager and TransactionManager
                mskonda Apprentice

                 

                "mark.little@jboss.com" wrote:
                First you need to make sure you've got the local JTS XARecoveryModule in place (the one in the arjunacore package). You can remove the XARecoveryModule in the jts package.


                I am using -
                com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule


                The recovery manager will look for the object store in wherever you've set it in your jbossjts-properties.xml (which is searched for in the cwd and your classpath). If you don't change the default setting in there (or the system can't find the property file), then it'll default to cwd and be called PutObjectStoreDirHere. Can you confirm that this is the case?


                Yes, it creates this PutObjectStoreDirHere directory and logs all the actvities.


                Next, do you actually have any entries in the object store to recover? You say that the failure happens during prepare. In that case it depends where in prepare, because the transaction system will only write the log entry once all of the participants have successfully prepared. Failures before that will cause the transaction to roll back so there will be no recovery.

                I kill the appserver (XAResource is obtained from there) during prepare or commit phase of my second XAResource (DummyXAResource). I can see the uncommitted transactions in StateManager/BasicAction/TwoPh../AtomicAction directory in #num># form



                • 5. Re: RecoveryManager and TransactionManager
                  Mark Little Master

                  What are the two XAResource implementations you use? Are they serializable for instance?

                  • 6. Re: RecoveryManager and TransactionManager
                    Mark Little Master

                    BTW, I'd recommend reading http://www.jboss.com/index.html?module=bb&op=viewtopic&t=82480&postdays=0&postorder=asc&start=0 as some of it is relevant to XAResource recovery (and I don't want to rewrite it all again here). Don't post anything to that forum though: I'm mentioning it here purely for informational purposes only.