Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Object Relational Mapping and the fly likes transaction rollback during multiple session Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "transaction rollback during multiple session" Watch "transaction rollback during multiple session" New topic
Author

transaction rollback during multiple session

Abubacker Siddik
Ranch Hand

Joined: Aug 12, 2009
Posts: 90
Hi
I am trying to write a framework class which can be used by our applications. This class provides methods to create hibernate session and ways to commit and rollback the transaction. I have designed in such a way that there will be always two methods to do commit, rollback and creating sessions. To put it clearly, to create session, one method will give default session by calling openSession on SessionFactory, second method will get a parameter from the user to create new session rather than to return session created by default. Likewise to commit, i will have commit method which will commit default session transaction, but for second commit method, i will get parameter that will accept session object and commit on that particular session. Same applies to rollback method also.

My question is, When user gets session and works on it, an exception occurs that will be caught by my framework class. Now how will i identify which session the user was using and which transaction should i rollback in my catch block? It can be default session or new session created by the customized method. How to know the origin of the exception or from which session the exception was thrown?


Kindly help me guys..


Thanks in Advance.
Abu.A
Abubacker Siddik
Ranch Hand

Joined: Aug 12, 2009
Posts: 90

Any help guys..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: transaction rollback during multiple session
 
Similar Threads
please answer this 128 questions for WLS. Urgently!
Question for CMT Session Bean
difference between userTransaction.rollback() & userTransaction timeout
Passed SCBCD 5.0 :)
Problem with ejb transaction