0 Replies Latest reply on Jun 10, 2010 10:22 AM by Michal Szymanski

    lookup or UserTransaction.userTransaction().begin() ?

    Michal Szymanski Newbie

      In discussion http://community.jboss.org/thread/153003 there was a suggestion to use:


      UserTransaction utx = null;


      utx =  (javax.transaction.UserTransaction) dic.lookup("UserTransaction");


      lookup instead



      Is it a performance difference between these methods? In first method we have to additionaly retrieve initial context. As I understand each time I start new transaction it is necessary to make lookup("UserTransaction")  but initial contex can be stored in static value ,am I right?