# @Transactional propagation = Propagation.REQUIRES\_NEW

**URL:** https://discourse.hibernate.org/t/transactional-propagation-propagation-requires-new/7278
**Category:** Hibernate ORM
**Created:** [February 20, 2023, 10:42am UTC](https://discourse.hibernate.org/t/transactional-propagation-propagation-requires-new/7278 "2023-02-20T10:42:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lromano](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@lromano](https://discourse.hibernate.org/u/lromano)
#### Post date: [February 20, 2023, 10:42am UTC](https://discourse.hibernate.org/t/transactional-propagation-propagation-requires-new/7278/1 "2023-02-20T10:42:06Z")

</div>

We have this behaviour in our environment.

Hibernate 5.6.14.Final  
SpringBoot 2.7.7

We call a method (method1) with annotation @Transactional; inside the method1 we call another method (method2) with annotation @Transactional(propagation = Propagation.REQUIRES\_NEW).

In the method2 we have one insert and one update in table.  
When exiting from method1 the same update and insert in table occur causing a data integrity violation.

How can we make the changes made in method2 visible to method1 so that the second insert/update does not occour? Thanks in advance

Thanks in advance.

---

<div class="post-metadata">

### Author: ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)
#### Post date: [February 21, 2023, 8:03am UTC](https://discourse.hibernate.org/t/transactional-propagation-propagation-requires-new/7278/2 "2023-02-21T08:03:45Z")

</div>

This depends on the transaction isolation level that you used. Using SNAPSHOT isolation (also known as repeatable read) will not work. You have to configure the READ COMMITTED isolation level. Since you start the first transaction with method1 before the second in method2, the first transaction would never see anything that happens after it started when using SNAPSHOT isolation.

---

<div class="post-metadata">

### Author: ![lromano](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@lromano](https://discourse.hibernate.org/u/lromano)
#### Post date: [February 21, 2023, 8:57am UTC](https://discourse.hibernate.org/t/transactional-propagation-propagation-requires-new/7278/3 "2023-02-21T08:57:02Z")

</div>

Hi Beikov,

thanks for the hint; but as far as I know for PostgreSQL (the database engine we use) READ COMMITTED is the default isolation level.

---

<div class="post-metadata">

### Author: ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)
#### Post date: [February 21, 2023, 9:01am UTC](https://discourse.hibernate.org/t/transactional-propagation-propagation-requires-new/7278/4 "2023-02-21T09:01:52Z")

</div>

In that case, you’d need to share your code with us. What does method1 and method2 do? How do the entities look like?

---

<div class="post-metadata">

### Author: ![floss.dev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/floss.dev/32/2192_2.png) [@floss.dev](https://discourse.hibernate.org/u/floss.dev)
#### Post date: [February 23, 2023, 9:34pm UTC](https://discourse.hibernate.org/t/transactional-propagation-propagation-requires-new/7278/5 "2023-02-23T21:34:29Z")

</div>

Hi @lromano

Try putting method2 in another class  
Just guessing…
