8 Replies Latest reply on Nov 22, 2002 5:04 AM by Igor Vinnikov

    Tyrex doesn't work

    Igor Vinnikov Newbie

      Hi, all.

      I try to use Tyrex for distributed transactions.
      In order to use Tyrex I configured it:

      1. Build tyrex-tm-plugin.jar from varia\build.xml
      2. Download tyrex.jar v 1.0 from tyrex site.
      3. Copy tyrex-tm-plugin.jar, tyrex.jar and xerces.jar to all/lib in JBoss.
      4. Comment JBoss transaction manager and uncomment Tyrex in jboss-service.xml by following:

      ../server/all/conf/domain.xml


      5. Create in conf following domain.xml:

      default


      I do these steps in both my JBoss instances. Then I start them and there are no any problems - it seems that Tyrex works. When I try to test distributed transaction - Tyrex don't work. When I use default JBoss transaction manager, I receive "org.jboss.tm.TransactionImpl is not serializable", when I use Tyrex - I receive "tyrex.tm.impl.TransactionImpl is not serializable".

      Why Tyrex distributed transactions does not works? What I need to configure?

      I use JBoss 3.0.2 and have 2 JBoss instances on one machine.

      Help me !!!

        • 1. Re: Tyrex doesn't work
          David Araujo Newbie

          Hi,

          i have exactly the same problem.

          Have you find a solution to this problem ?

          Thanks

          .david

          • 2. Re: Tyrex doesn't work
            Anatoly Akkerman Newbie

            Can you provide a stack trace?

            I may take a look at it if I have time.

            • 3. Re: Tyrex doesn't work
              Igor Vinnikov Newbie

              I found a problem. Problem occures because JBoss bug #610392. In order to fix this bug in MarshalledInvocation.writeExternal()
              we need to filter content of as_is_payload map and don't
              write transaction objects.

              I fix it - it seems working (on distributed transaction
              with Tyrex transaction manager).

              If anybody want my fix - write me on vinny5@rambler.ru.

              Best regards,
              Igor Vinnikov

              • 4. Re: Tyrex doesn't work
                Manuel Elaraj Newbie

                Igor,
                Please post the resolution. We are having exactly this issue. I think JBOSS 3.0.X should start shiping with tyrex as the default transaction manager.

                Thanks,
                Manuel

                • 5. Re: Tyrex doesn't work
                  Manuel Elaraj Newbie

                  Although the code changes I got from Igor cause the error to go away tranasctions are not being completed correctly. If one of the beans calls setRollback only, the rest of the bean's changes to the databases are commited. The tyrex plugin for JBOSS is not working correctly. What is the point of a J2EE server that supports clustering if it does not support distributed transactions? I am sure this is going to become and important issue. Is anyone from development reading these threads?

                  Manuel

                  • 6. Re: Tyrex doesn't work
                    Sacha Labourey Master

                    For the pure Tyrex thing, Anatoly seems to be your man. As for clustering, most (if not all) deployments do not use distributed transactions (and this not only with JBoss, but with WL, etc.): they are much much slower, and may have strange consequences at the db level. Furthermore, very few DBs have a correctly implemented XA driver.

                    I don't remember the URL, but a few times ago there was a very nice article about this issue on Borland web site written by one of their app server lead architect.

                    Consequently, use homogeneous deployments and deploy everything everywhere.

                    Cheers,


                    sacha


                    P.S.: BTW, Tyrex doesn't fully implement a 2PC DTM. I don't think that transaction logging and recovery is implemented.

                    • 7. Re: Tyrex doesn't work
                      Igor Vinnikov Newbie

                      In standard Tyrex implementation I found some problems, so standatd Tyrex version cause some errors where it works with JBoss. I constantly found some problems in it implementation. So I found such problems:

                      1. Tyrex doesn't correctly works with JBoss. JBoss compares 2 transactions by equals() method. This two transactions can be equal, but use different objects in case of distributed call and restoring transaction from TPC. I implemented equals() method in TransactionImpl.java

                      2. Error in detection of possibility 2PC. If there are some enlisted resources - one phase commit is performed.
                      Cause an error when I reguster my own XAResource (other XAResource was DB connect), which must rollback transaction. In this case transaction detects that can perform one-phase commit, so data in DB was commited.
                      I change implementation of canUseOnePhaseCommit() in TransactionImpl.java

                      3. Fix problem with distributed transactions. When remote invoke occurs TPC is propagated. On remote side new transaction creates (it is mould of current transaction). This new transaction registers as OTS resource in current transaction. When current transaction completes, there are determiniation of possibility one-phase-commit. If current transaction contains only one OTS resource one-phase-commit performed and all is OK. But if there are two-phase-commit, TransactionImpl.prepare() method invokes firstly. This method call prepare() for all resources, so in our case prepare() invokes for remote side transaction (mould of current transaction). Because of this transaction does not contain resources, it votes as Vote.VoteReadOnly, so current transaction determines that is read-only, so commit for resources is not performed (it is a error, because remote transaction not finished - is alive forever, so after some timeout TransactionDomain try to forget it, but can't because transaction is active). So we need to commit also in case of Heuristic.READONLY when there are no any resources.
                      I change prepare() method of TransactionImpl.java

                      4. There are problems with set of transaction timeout. The maximum value of timeout is 10min. Even if your set 2h :)), it will be only 10min. I need to more flexible setting of timout time, so I fix it too.

                      Also, I fix bug in JBoss clustering (solve problem with Transaction marshalling, about which I post it this thread firstly)

                      Possible there are other bugs in Tyrex (and in JBoss clustering too), but with this fixes, my current projects works correctly. I don't specially tested Tyrex and JBoss clustering, I implement my project and when I found bug I try to fix it. So list of bugs, possibly is not complete :) If you found any other problems, or you have questions, write my on vinny5@rambler.ru

                      Best regards,
                      Igor Vinnikov

                      • 8. Re: Tyrex doesn't work
                        Igor Vinnikov Newbie

                        In standard Tyrex implementation I found some problems, so standatd Tyrex version cause some errors where it works with JBoss. I constantly found some problems in it implementation. So I found such problems:

                        1. Tyrex doesn't correctly works with JBoss. JBoss compares 2 transactions by equals() method. This two transactions can be equal, but use different objects in case of distributed call and restoring transaction from TPC. I implemented equals() method in TransactionImpl.java

                        2. Error in detection of possibility 2PC. If there are some enlisted resources - one phase commit is performed.
                        Cause an error when I reguster my own XAResource (other XAResource was DB connect), which must rollback transaction. In this case transaction detects that can perform one-phase commit, so data in DB was commited.
                        I change implementation of canUseOnePhaseCommit() in TransactionImpl.java

                        3. Fix problem with distributed transactions. When remote invoke occurs TPC is propagated. On remote side new transaction creates (it is mould of current transaction). This new transaction registers as OTS resource in current transaction. When current transaction completes, there are determiniation of possibility one-phase-commit. If current transaction contains only one OTS resource one-phase-commit performed and all is OK. But if there are two-phase-commit, TransactionImpl.prepare() method invokes firstly. This method call prepare() for all resources, so in our case prepare() invokes for remote side transaction (mould of current transaction). Because of this transaction does not contain resources, it votes as Vote.VoteReadOnly, so current transaction determines that is read-only, so commit for resources is not performed (it is a error, because remote transaction not finished - is alive forever, so after some timeout TransactionDomain try to forget it, but can't because transaction is active). So we need to commit also in case of Heuristic.READONLY when there are no any resources.
                        I change prepare() method of TransactionImpl.java

                        4. There are problems with set of transaction timeout. The maximum value of timeout is 10min. Even if your set 2h :)), it will be only 10min. I need to more flexible setting of timout time, so I fix it too.

                        Also, I fix bug in JBoss clustering (solve problem with Transaction marshalling, about which I post it this thread firstly)

                        Possible there are other bugs in Tyrex (and in JBoss clustering too), but with this fixes, my current projects works correctly. I don't specially tested Tyrex and JBoss clustering, I implement my project and when I found bug I try to fix it. So list of bugs, possibly is not complete :) If you found any other problems, or you have questions, write my on vinny5@rambler.ru

                        Best regards,
                        Igor Vinnikov