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?
|