2 Replies Latest reply on Aug 18, 2001 10:36 PM by nhebert

    how to get usertransaction using client application???

      i wrote a BMP and CMT entity bean, and deployed it in the jboss 2.2.2, but i do not know how to get the usertransaction in my client application. the ejb1.1 speciafication says that i could lookup it with JNDIname 'java:/comp/UserTransaction, but i failed, so could you help me? pls give a response ASAP, or you can contact me with my mail box jacky@erry.com, thanks

        • 1. Re: how to get usertransaction using client application???
          gray

          try using this instead

          UserTransaction transaction = (UserTransaction)ctx.lookup("UserTransaction");

          • 2. Re: how to get usertransaction using client application???
            nhebert

            Jacky,

            Since this forum is for EJB design I would like
            to point out that, in general, it is considered
            bad practice to propagate a transaction that
            starts in an application client.

            Under most situations it is better to call a
            method on a stateless session bean which starts
            the transaction. This prevents a client from
            starting a transaction and say walking away to
            get a cup of coffee or go to lunch and lock
            resources (transactional isolation).

            This may be what you want. Just saying this
            is not something you should normally do.

            Just my thoughs.

            Cheers,

            Noel.