This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
Hello Everyone, Can somebody tell me if there is any way to use the transaction API in non-EJB applications? For example: I have just a servlet/JSP application, but I would like to use javax.transaction.* for handling DB transactions, instead of making my own transactions by manipulating autoCommit and what not. Is there any way? Has anyone done this before? Thanks, Rohit
posted 14 years ago
You can use Java transaction api in a JSP or Servlet but you'll have to compile and run it in a J2EE engine. e.g. if you have a jsp page calling two java beans having their own connection instance performing a dabase action, but if one beans throws and exception the other bean also has to rollback the activity. In such case you have to use the transaction API. Rest figure it out