aspose file tools*
The moose likes Object Relational Mapping and the fly likes How to interrupt(stop) the transction while doing the proces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to interrupt(stop) the transction while doing the proces" Watch "How to interrupt(stop) the transction while doing the proces" New topic
Author

How to interrupt(stop) the transction while doing the proces

stshiva raaj
Greenhorn

Joined: Sep 23, 2008
Posts: 28
I have to interrupt(stop) the tranaction when its take longer time. I am using thread local to create new session per request.
The process is one request to create the session and commit the transaction. Meanwhile i need to interrupt the transaction after
transaction is created.

Session session = HibernateSessionFactory.createNewSession();
Transaction tran=session.beginTransaction();
................
...............
tran.commit();
My requirement is , i have sent one more request to cancel the transaction. If the transaction is already completed, i just ignore the cancel.
Otherwise, i need to stop the tranasction if it will take longer time.
Session session = HibernateSessionFactory.createNewSession();
Transaction tran=session.beginTransaction();
................
...............//Need to stop the transaction before commit!
...............
tran.commit();
Is it possible? How to achieve this work?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to interrupt(stop) the transction while doing the proces