• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
please buy my thing and then I'll have more money:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic