cancel
Showing results for 
Search instead for 
Did you mean: 

How to interrupt(stop) the transction while doing the process of save(),update() or merge()(i.e beginTransaction---commit())

stsivaraj
Champ in-the-making
Champ in-the-making
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?
1 REPLY 1

trademak
Star Contributor
Star Contributor
I don't see what this has to do with Activiti. It seems to be more a Hibernate question. Could you explain what exactly you would like to get from Activiti?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.