0 Replies Latest reply on Aug 8, 2003 2:12 AM by Klaus Thiele

    Transaction Problem/Question

    Klaus Thiele Newbie

      Hello,

      following scenario:

      - a SFSB/CMT named MainBean with method mainMeth()
      - a SFSB/BMT named SubBean with method subMeth()
      - in the create-method of MainBean there was an instance of SubBean created.
      - then mainMeth() was called and from here a call to subMeth() of the created instance of SubBean.
      - for some reasons, SubBean was BMT and i need a UserTransaction in subMeth() so i do following:

      ut = ctx.getUserTransaction();
      if( ut.getStatus() != Status.STATUS_NO_TRANSACTION ) {
      System.out.println("the current thread is already associated with a transaction!");
      ...

      i would expect, that the ut.getStatus will discover that there already is a Transaction active - because MainBean/mainMeth() is CMT and Required as attribute!
      But it discovers it not! and i can do ut.begin() and so on and get unexpected behaviour (SubTransactions not allowed....).

      this is not correct, isn't it?

      tia
      klaus