Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction processing

 
Richard Robbins
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My current method for doing transactions is to set the auto commit property to false when doing an executeUpdate. I then use commit() when the transaction is completed and rollback() when necessary. Is there an alternative (and better) way to accomplish transactions?
 
asnmurthy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YEs, there is another way to do this also. Your method is perfect. But when the session is timedout then and if you are doing some transaction in the databse, you may not store the proper data in the database. For this purpose use HttpSessionBindingListener to wrap yoour connection object wqith the session. Whenever the session is timed out then your corresponding ValueUnbound method will be called in which you can roll back or whatever you want to do , you can do it before rollingback or doing some stuff.
Hope this answerrs your question.
Regards,
Murthy
A.Murthy@gecapital.com
------------------
Thanks & Regards,
Murthy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic