Category: Database, container, github

Spring allows you to control the behavior of logical and physical transactions via transaction propagation mechanisms. There are seven types of transaction propagation mechanisms that you can set in a Spring application via org.springframework.transaction.annotation.Propagation.

This is happening because the inner logical transaction sets the rollback-only marker, and, since the scopes of both logical transactions are mapped to the same physical transaction, the outer logical transaction is rolled back as well.

Step 2: Since none is available, Spring will not cause an exception and will run this method’s code outside of a physical transaction.

In other words, the database connection is active even when its bounded transaction is suspended: Propagation.SUPPORTS states that if a physical transaction exists, then it will execute the demarcated method as a logical transaction in the context of this physical transaction.

Related Articles