0 Replies Latest reply on Sep 29, 2009 10:41 AM by Endre Nagy

    Transaction Demarcation : Same vs Different Server

    Endre Nagy Newbie


      Am running JBoss 4.0.5 Application Server

      Deployed thereon, as an ear file, is an EJB 3 Stateless Session Bean

      The Bean, by neccessity performs its own transaction demarcation (i.e the Bean performs explicit beginTransaction and commitTransaction via calls to Hibernate V 3.2.5).

      The Bean is invoked by a Service deployed as a sar file. The Bean is accessed by the Service, in ALL cases, via a JNDI Naming Context lookup.

      The Service class also performs its own explicit transactional demarcation.

      The problem is that the Service class behaves differently in the situation where it is deployed in a different application server instance to the Bean than if they are deployed in the same server.

      In the situation of seperate servers it is possible to support two distinct simulataneous transactions (the desired result) . In the case of colocated archives deployed to the same server it is not. In this case the Beans commitTransaction also closes the open transaction in the calling Service . This is not desired, two independent transactions should be maintained in this case as well.

      Ive breifly investigated forcing the Service not to perform any call optomization (e.g forcing a remoting lookup rather than a direct in memory method call) but without luck.

      How can I enforce distinct Transactional Contexts in the colocated case