Ignasi
Ignasi

Reputation: 6185

spring transactional nested open session?

If a method of service is marked as @Transactional with propagation nested, and inside it there are many calls to other @Transactional methods, each one of these methods will use its own session? It should represent many connections to db for just one method call no?

Upvotes: 1

Views: 652

Answers (1)

Harshal Patil
Harshal Patil

Reputation: 6759

It looks like PROPAGATION_REQUIRED is better option for your purpose. From its javadoc:

Support a current transaction; create a new one if none exists.

Refer this link for more details

Upvotes: 2

Related Questions