Spring transaction propagation mechanism
Spring specifies 7 types of transaction propagation behavior in the TransactionDefinition interface, which specify how transactions and transaction methods occur when nested calls occur:
Transaction propagation behavior type
If there is no transaction at the moment, create a new transaction. If there is already a transaction, add it to this transaction. This is the most common choice,.
Supports the current transaction. If there is no transaction at the moment, execute in non transaction.
Using the current transaction, throw an exception if there is no transaction at the moment.
New transaction. If current transaction exists, suspend the current transaction.
Performs operations in non - transactional ways. If current transactions exist, suspend the current transaction.
Non transactional execution. If an existing transaction exists, an exception is thrown.
If there is a transaction currently, it is executed within nested transactions. If there is no transaction at the moment, the operation similar to that of PROPAGATION_REQUIRED is performed.
When using PROPAGATION_NESTED, the underlying data source must be based on JDBC 3, and the implementer needs to support the save point transaction mechanism.