2 Replies Latest reply on Nov 16, 2007 8:58 AM by breako

    Using JTA and JNDI

    breako

      Hi,
      I want my applications to use JTA and get JTA transactions using JNDI without using an App Server or an EJB server.

      Now, I have just figured out how to use JTA transactions without using an App Server. I am using the:

      com.arjuna.ats.jta.UserTransactionuserTransaction() to get a handle on a javax.transaction.UserTransaction interface,
      this all works fine (for more info see: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=123541&postdays=0&postorder=asc&start=20).

      I could just register this transaction object with JNDI programatically, but I think this sounds too simple. For start what about concurrent transactions?

      I was just wondering has anyone gone down this root and how they got on?

      Ultimately where I am going is I want to use JPA, with UserTransactions without the overhead of an EJB server.

      Thanks a million.





        • 1. Re: Using JTA and JNDI
          jhalliday

          > I could just register this transaction object with JNDI programatically, but I think this sounds too simple. For start what about concurrent transactions?

          Customer satisfaction is a high priority for us, so I'll see what we can do to make it harder for you if you like :-)

          The UserTransaction implementation is a threadsafe singleton, so stuffing it into JNDI is fine. That's what the JNDIManager class is for.

          > Ultimately where I am going is I want to use JPA, with UserTransactions without the overhead of an EJB server.

          *cough* premature optimization *cough*
          Seriously, do you actually know how much overhead there is in e.g. JBoss embedded?

          • 2. Re: Using JTA and JNDI
            breako

             

            "jhalliday" wrote:
            > I could just register this transaction object with JNDI programatically, but I think this sounds too simple. For start what about concurrent transactions?

            Customer satisfaction is a high priority for us, so I'll see what we can do to make it harder for you if you like :-)

            The UserTransaction implementation is a threadsafe singleton, so stuffing it into JNDI is fine. That's what the JNDIManager class is for.

            > Ultimately where I am going is I want to use JPA, with UserTransactions without the overhead of an EJB server.

            *cough* premature optimization *cough*
            Seriously, do you actually know how much overhead there is in e.g. JBoss embedded?

            I think there's an element of perspective here.
            Some of our customers are reticent about using an EJB server. They not need one now. I have been giving requirments to see how far we can without so that is what I am trying to do. Maybe sounds silly, but there's a reality here - I can't just say to customer that's silly, I need to know how far it can.
            I have used the Embedded EJB server, little overhead I agree but again we are talking customers here.