3 Replies Latest reply on Feb 4, 2009 4:20 AM by adinn

    Remote EJB Transaction Problem

    sunny.mikel

      There are two remote EJBS talking to each other on two different JBOSS AS (version 4.2.3) .Each EJB has methods that have transactional attribute Requied.

      The methods in each EJB use JPA(Hibernate as ORM). Now my requirement is that When one EJB1 calls the method of EJB2 on other Server the insertions into the databases should be transactional i:e either everything should succeed or everything should fail.

      Scenario :

      EJB1
      TransactionalAttribute.Requied

      x()
      {
      JPA_Statement_x1;

      y();

      JPA_Statement_x2;
      }

      EJB2
      TransactionalAttribute.Requied
      y()
      {
      JPA_Statement_y1;
      .....
      }


      Now if JPA_Statement_x2 in calling bean(EJB1) fails y()((EJB12) should roll back as well(i:e JPA_Statement_y1 should not get executed at all).
      I tried with JBOSS AS Version 4.2.3 but it seems to fail.

      Can someone provide a solution please. The database is mysql.

        • 1. Re: Remote EJB Transaction Problem
          mmusgrov

          To do distributed transaction propagation you need to install the JTS version of the JBossTS product. There are issues with the (inbound) IIOP invokers on 4.2 but the default (propagation via RMI) should work. Note that for these reasons the 4.2 version is not supported.

          • 2. Re: Remote EJB Transaction Problem
            sunny.mikel

            Thanks mmusgrov.
            I will be highly thankful and appreciative if you can further provide the precise server version and corresponding JBOSSTS version on which the Remote EJB Transaction Context propogation works. Currently I am using JBOSS AS 4.2.3 .

            In 4.2.2 Version there was a problem with Remote EJB invocation but in 4.2.3 things seemed to work fine.

            Also do I need to separately download and configure JBOSSTS JTS and JTA jars for in latest versions?

            I somehow got the info that they ship in with newer versions of JBOSS AS.

            Thanks,
            Sunny

            • 3. Re: Remote EJB Transaction Problem
              adinn

              The JTA jars ship with the AS ready-installed in the default server. The JTS jars are not currently shipped with the AS (that is about to change with the latest AS 5.x release).

              If you want to use JTS you need to obtain a JBossTS source tree from svn, build the JTS jars and then replace the JTA jars with the newly built JTS jars. Instructions can be found in the JBossTS source tree (see ArjunaJTS/INSTALL).

              Ideally you should use the JBossTS source version which was used to build JBossAS 4.2.3 i.e. JBossTS 4.2.3.SP7.