# Rollback all persisted data in multithreading if one thread got exception in Hibernate

**URL:** <https://discourse.hibernate.org/t/rollback-all-persisted-data-in-multithreading-if-one-thread-got-exception-in-hibernate/2658>\
**Category:** Hibernate ORM\
**Created:** [May 2, 2019, 10:11am UTC](https://discourse.hibernate.org/t/rollback-all-persisted-data-in-multithreading-if-one-thread-got-exception-in-hibernate/2658 "2019-05-02T10:11:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karan\_Bathla](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/karan_bathla/32/573_2.png) [@Karan\_Bathla](https://discourse.hibernate.org/u/Karan_Bathla)\
**Post date:** [May 2, 2019, 10:11am UTC](https://discourse.hibernate.org/t/rollback-all-persisted-data-in-multithreading-if-one-thread-got-exception-in-hibernate/2658/1 "2019-05-02T10:11:50Z")

</div>

I want to Rollback all persisted data in multithreading if one thread got exception in Hibernate

---

<div class="post-metadata">

**Author:** ![Naros](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/naros/32/19_2.png) [@Naros](https://discourse.hibernate.org/u/Naros)\
**Post date:** [May 2, 2019, 6:46pm UTC](https://discourse.hibernate.org/t/rollback-all-persisted-data-in-multithreading-if-one-thread-got-exception-in-hibernate/2658/2 "2019-05-02T18:46:03Z")

</div>

Are you attempting to use the same `Session` or `EntityManager` across multiple threads?
