• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transactions in Servlet

 
Ashish Pagare
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ashish Pagare
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic