2 Replies Latest reply on Mar 7, 2002 7:32 AM by Adrian Brock

    UserTransaction in MBean

    Michael Degtyarev Newbie

      Hello,
      I am developing a manageable bean that has to create two entity beans. These entity beans must be created in a transaction. I wonder is it possible to use for it aventurines ?
      If it is possible, how can I obtain UserTransaction inside of manageable bean ? I read that it's possible to obtain it using following lookups:

      UserTransaction transaction=(UserTransaction)ctx.lookup("java:/comp/UserTransaction");
      or
      UserTransaction transaction=(UserTransaction)ctx.lookup("UserTransaction");

      But, in my case both lookups fails with
      javax.naming.NameNotFoundException: UserTransaction not bound

      What's wrong? What am I missing ? I know that it's possible to use JTA transactions from client side (non-EJB) - in my case MBean acts as client.

      I use JBoss 2.2.2.

      Thanks,
      Michael