简体   繁体   中英

Spring Transaction Propagation from NOT_SUPPORTED to REQUIRES_NEW

I'm working on refactoring a module with an initial method annotated with @Transactional(propagation = Propagation.NOT_SUPPORTED) and this method invokes another method that has the annotation @Transactional(propagation = Propagation.REQUIRES_NEW) .

My question is, since the initial method is not creating a new transaction, the invoked method will create a new transaction?

Yes, the invoked method will create and run in a new transaction.

REQUIRES_NEW will always create a new transaction irrespective of transactional mode of caller method (even if caller already created a transaction).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM