Spring / Spring Data Access
What are the different Spring propagation levels?
Propagation is the ability to decide how the business methods should be encapsulated in both logical or physical transactions.
There are 7 different propagation levels.
REQUIRED states that the same transaction will be used if there is an already opened transaction in the current bean method execution context and it creates a new transaction if one already does not exists.
REQUIRES_NEW states that a new physical transaction will always be created by the container.
The NESTED makes nested Spring transactions to use the same physical transaction but sets save-points between nested invocations so inner transactions may also rollback independently of outer transactions. This is applicable only to JDBC.
The MANDATORY states that an existing opened transaction must already exist. If not an exception will be thrown by the container.
The NEVER states that an existing opened transaction must not already exist. If a transaction exists an exception will be thrown by the container.
The NOT_SUPPORTED will execute outside of the scope of any transaction. If an opened transaction already exists it will be paused.
The SUPPORTS will execute in the scope of a transaction if an opened transaction already exists. If there isn't an already opened transaction the method will execute anyway but in a non-transactional way.
More Related questions...