0 Replies Latest reply on Apr 30, 2009 12:04 AM by Frank Schwarz

    Distributed Transaction involving 2 nodes

    Frank Schwarz Newbie

      I'm trying to set up a szenario with a stand-alone client and two application server instances. The client is to invoke two ejb3 session-beans (one from each application server instance) in a transactional fashion.

      I carried out the instructions in jboss-5.0.0.GA.JDK6/docs/examples/jts/README.txt and set up the client as described in http://www.jboss.org/community/wiki/TransactionPropagationwithJBoss

      No luck so far. None of the session-beans is enlisted in any transaction.

      The beans:

      @Stateless
      @Remote(BusinessInterface1.class)
      @RemoteBinding(factory = RemoteBindingDefaults.PROXY_FACTORY_IMPLEMENTATION_IOR, jndiBinding="Bean1")
      public class Bean1 implements BusinessInterface1 {
       @TransactionAttribute(TransactionAttributeType.MANDATORY)
       public void businessMethod1() {...}
      }
      


      The client:
      Properties jndiSetup1 = new Properties( );
      jndiSetup1.put( InitialContext.PROVIDER_URL, "corbaloc::10.2.0.1:3528/JBoss/Naming/root" );
      jndiSetup1.put( InitialContext.INITIAL_CONTEXT_FACTORY, com.sun.jndi.cosnaming.CNCtxFactory.class.getName( ) );
      jndiSetup1.put( InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
      
      com.arjuna.orbportability.ORB orb = com.arjuna.orbportability.ORB.getInstance("ClientSide");
      com.arjuna.orbportability.RootOA oa = com.arjuna.orbportability.OA.getRootOA(orb);
      orb.initORB(new String[] {}, null);
      oa.initOA();
      com.arjuna.ats.internal.jts.ORBManager.setORB(orb);
      com.arjuna.ats.internal.jts.ORBManager.setPOA(oa);
      
      InitialContext ic1 = new InitialContext( jndiSetup1 );
      Interface1 bean1 = (Interface1) ic1.lookup("java:Bean1");
      
      com.arjuna.ats.jts.OTSManager.get_current().begin();
      bean1.businessMethod1();
      boolean reportHeuristics = true;
      com.arjuna.ats.jts.OTSManager.get_current().commit(reportHeuristics);
      


      What am I missing.

      Kind regards,
      Frank