This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
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
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.
Joined: Oct 14, 2003
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.
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