1 2 Previous Next 21 Replies Latest reply on Feb 7, 2008 2:56 PM by wanttransaction

    Transaction Recovery using two EJBs on two different machine

    yuvalry

      Hi All,

      I am using JBoss 4.2.2GA and Oracle 10G DB.

      I am trying to call from an EJB deployed on machine A an EJB deployed on machine B and then rollback the transaction from machine A (by calling the setRollbackOnly method).

      Both EJBs are CMT and marked as "Required".
      I am using the XA DS for Oracle.
      The EJB logic inserts something in DB.

      The expected result is that transaction on machine B will be also rollback.

      I have tried to use the JBoss 4.2.2 without any changes (using the JTA) and the result was that transaction on machine B was committed.

      Then I replaced the default JTA with JTS but got the same result (transaction on machine B is still committed).

      Does anyone know what I am doing wrong?

      Thanks,
      Yuval

        • 1. Re: Transaction Recovery using two EJBs on two different mac
          jhalliday

          That would probably be because the JTS is broken on 4.2 Wait for EAP 5.0, I've just finished writing the JTS tx context propagation code for that and it rocks.

          • 2. Re: Transaction Recovery using two EJBs on two different mac
            ana.tudosa

            Hi,

            Assuming we cannot wait untill the Jboss 5.0 will be out, could you please suggest another solution?

            Again I assumed that by EAP 5.0 means Jboss 5 :-D

            Thanks,
            Ana

            • 3. Re: Transaction Recovery using two EJBs on two different mac
              jhalliday

              > Assuming we cannot wait untill the Jboss 5.0 will be out, could you please suggest another solution?

              Yes, two actually. Fix the JTS for 4.2 and contribute your patches back the community. Or hop on a plane to JBossWorld in Orlando next week and buy me lots of drinks.

              > Again I assumed that by EAP 5.0 means Jboss 5 :-D

              JBoss is a division of Red Hat. Did you mean JBossAS 5.0? :-) I was very specific in the phrasing... I'm committed to making JTS work for EAP 5.0 i.e. the paying customers of the Enterprise Application Platform. As a side effect of that it will probably work on JBossAS 5.0 too, but no guarantees.

              • 4. Re: Transaction Recovery using two EJBs on two different mac
                wanttransaction

                Hello All,

                I have exactly the same problem as yuvalry. Is using JBossAS 4.0.x an option? Because JBoss Transactions 4.2.3.SPx JTS should work with this JBossAS version (see http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossTransactionsVersionGuide for details)

                I didn't try using JTS with JBossAS 4.0.x because I need EJB 3.0 support. There is a patch for integrating EJB 3.0 in JBossAS 4.0.x, but that didn't work...

                @yuvalry: how exactly did you replace JTA with JTS in JBossAS 4.2.2GA? I followed the installation instructions that come along with JBossTS, but after that JBossAS wouldn't start without Exceptions...

                @jhalliday: any suggestions on fixing the EJB 3.0 problem with JBossAS 4.0.x? And does JTS really work with JBossAS 4.0.x? Coming over to Orlando is not an option for me :p

                • 5. Re: Transaction Recovery using two EJBs on two different mac
                  jhalliday

                  What are the exceptions you get on 4.2.2? it should work well enough to start up without errors at least...

                  • 6. Re: Transaction Recovery using two EJBs on two different mac
                    wanttransaction

                    Hi jhalliday,

                    thx for quick reply! I am using JBossAS 4.2.1GA and tried to patch it with JBossTS 4.2.3SP7. I can't tell you what Exceptions I got exactly, because I returned to JTA. It was somehow caused by CorbaORB from the JTS configuratio in jboss-service.xml:

                    <!-- JBoss Transactions JTS -->
                    <mbean code="com.arjuna.ats.jbossatx.jts.TransactionManagerService"
                     name="jboss:service=TransactionManager">
                     <depends>jboss:service=CorbaORB</depends>
                     <attribute name="TransactionTimeout">300</attribute>
                    </mbean>
                    


                    But if I don't get the transaction rolled back on a remote JBossAS instance even if I use JTS I won't use JTS anyway.

                    Cheers

                    • 7. Re: Transaction Recovery using two EJBs on two different mac
                      jhalliday

                      The known issues with JTS relate to RMI/IIOP tx propagation. If you are using JRMP for the business method calls it should provide distributed tx behaviour.

                      • 8. Re: Transaction Recovery using two EJBs on two different mac
                        wanttransaction

                         

                        "jhalliday" wrote:
                        The known issues with JTS relate to RMI/IIOP tx propagation. If you are using JRMP for the business method calls it should provide distributed tx behaviour.


                        OK, didn't know that. So, if I get JBossAS running with JBossTS JTS and use JRMP for calling EJB methods on a remote JBossAS instance the rollback on the remote host should work? How do I configure JBossAS to use JRMP?

                        Thanks a lot for your assistance!

                        • 9. Re: Transaction Recovery using two EJBs on two different mac
                          jhalliday

                          > How do I configure JBossAS to use JRMP?

                          Umm, it's the default? :-)

                          • 10. Re: Transaction Recovery using two EJBs on two different mac
                            wanttransaction

                            wow, that's easy ;-)

                            ok, I'll have a try again...

                            • 11. Re: Transaction Recovery using two EJBs on two different mac
                              wanttransaction

                              Do I have to run my JBossAS instances in a clustered configuration to get distributed tx propagation?

                              Currently I have two independend JBossAS instances running on two different Hosts. Bean A on Host 1 calls method of Bean B on Host 2. Both JBossAS instances use their own PostgreSQL DB with XA DataSource configuration.

                              • 12. Re: Transaction Recovery using two EJBs on two different mac
                                jhalliday

                                > Do I have to run my JBossAS instances in a clustered configuration to get distributed tx propagation?

                                No.

                                • 13. Re: Transaction Recovery using two EJBs on two different mac
                                  wanttransaction

                                  This is the Exception I get after patching JBossAS 4.2.1GA with JBossTS 4.2.3GA (i followed the installation instructions that come along with JBossTS), running with "all" configuration:

                                  16:31:08,562 WARN [ServiceController] Problem starting service jboss:service=TransactionManager
                                  com.arjuna.common.util.exceptions.ManagementPluginException: com.arjuna.common.util.exceptions.ManagementPluginException: Failed to register mbeans: javax.management.InstanceAlreadyExistsException: com.arjuna.ats.properties:module=jta already registered.
                                  at com.arjuna.common.internal.util.propertyservice.PropertyManagerImpl.addManagementPlugin(PropertyManagerImpl.java:496)
                                  at com.arjuna.ats.jbossatx.jts.TransactionManagerService.startService(TransactionManagerService.java:142)
                                  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                                  at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                                  at $Proxy0.start(Unknown Source)
                                  at org.jboss.system.ServiceController.start(ServiceController.java:417)
                                  at org.jboss.system.ServiceController.start(ServiceController.java:435)
                                  at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                  at $Proxy4.start(Unknown Source)
                                  at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
                                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                                  at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                  at $Proxy9.deploy(Unknown Source)
                                  at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                                  at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                                  at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
                                  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                                  at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                                  at $Proxy0.start(Unknown Source)
                                  at org.jboss.system.ServiceController.start(ServiceController.java:417)
                                  at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                  at $Proxy4.start(Unknown Source)
                                  at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
                                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                  at $Proxy5.deploy(Unknown Source)
                                  at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
                                  at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
                                  at org.jboss.Main.boot(Main.java:200)
                                  at org.jboss.Main$1.run(Main.java:508)
                                  at java.lang.Thread.run(Unknown Source)

                                  any ideas?

                                  thanks!

                                  • 14. Re: Transaction Recovery using two EJBs on two different mac
                                    yuvalry

                                    Hi,

                                    For WantTransaction:

                                    I am using the JBoss 4.2.2GA and I upgrated to JTS JBossTS 4.2.2GA because it's the JTA version they use, and I didn't want to make too much changes. And at least it's started without any exceptions.

                                    For jhalliday:

                                    If using the JRMP is the default JBoss behaivor, why it didn't work for me. And why you said that its broken?

                                    That would probably be because the JTS is broken on 4.2


                                    Can you please give a straight answer if it's suppose to work. And if yes in what configuration?

                                    Thanks

                                    1 2 Previous Next