• Post Reply Bookmark Topic Watch Topic
  • New Topic

UserTransaction from Servlet in WebSphere, UserTransaction bound w/o any configuring

 
Sam Gehouse
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is UserTransaction already configured in WebSphere without me additionally configuring it in WebSphere?

In other words, should I have any problem if I call:
UserTransaction tx = (UserTransaction) ServerConnector.getContext().lookup("java:comp/UserTransaction");

I am calling the above code from a Servlet based application (no EJB) deployed in WebSphere 5.1.

Has anyone had any problem in calling UserTransaction from a servlet based application (no EJB involved) deployed in WebSphere 5.1.x?

The code is like:

UserTransaction tx = (UserTransaction) ServerConnector.getContext().lookup("java:comp/UserTransaction");

tx.begin();

tx.commit() or tx.rollback();
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!