Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

user transaction from servlet or a nornal java class  RSS feed

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
How can i use the user transaction from a servlet or a normal jave class. Its basically how can i get the user transaction object to start the transaction.
A piece of code could be helpful
TIA
Anil
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would basically get it from the Context. For eg:

[ May 03, 2002: Message edited by: Junaid Bhatra ]
 
anil bisht
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This line gives me error..
UserTransaction utx = (UserTransaction)context.lookup("javax.transaction.UserTransaction
how do i bind the name ??

Regrds
Anil
 
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny ad ...
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!