aspose file tools*
The moose likes Servlets and the fly likes Transactions in Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Transactions in Servlet" Watch "Transactions in Servlet" New topic
Author

Transactions in Servlet

Ashish Pagare
Ranch Hand

Joined: Oct 14, 2003
Posts: 101
Hi,
I have a basic question about how to achieve transaction capability in a servlet. How do u achieve the rollback capabilites if a database save fails?
I hope some one will shed some light.
Regards,
Ashish
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
you would do it the same way as you would in any java program, so this would be better posted in one of the database forums. personally i dunno


Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
Ashish Pagare
Ranch Hand

Joined: Oct 14, 2003
Posts: 101
Thanks for replying Tim.
I understand that I can do the manual commit and rollback based on scenario. I am interested in knowing what is the approach taken to build jsp/servlet based projects. Like app servers provide transaction capabilites for EJB do we have anything for servlet.
Second thing which I have is how to simulate 2 phase commit in jsp/servlet.
I mainly work in middleware applications so not much acquainted with how to achieve the same in front end tier.
May be some other front end genius will help me here.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3879
It is possible to start and commit a JTA transaction in many servlet containers, thus allowing for 2-PC. However, not all servlet containers provide JTA support, although the two leaders (WebSphere and WebLogic) do.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transactions in Servlet
 
Similar Threads
sending data to servlets running in a different server
Redirect, but POST wanted.
CREATING FILE FROM SERVLET
how to maintain session in a servlet
Distributed Transactions