Spring 事务传播属性

来源:互联网 发布:dnf端口辅助破解器 编辑:程序博客网 时间:2024/04/24 13:19

Propagation behavior

What it means

PROPAGATION_MANDATORY

Indicates that the method must run within a transaction. If no existing transaction is in progress, an exception will be thrown.

PROPAGATION_NESTED

Indicates that the method should be run within a nested transaction if an existing transaction is in progress. The nested transaction can be committed and rolled back individually from the enclosing transaction. If no enclosing transaction exists, behaves like PROPAGATION_REQUIRED. Vendor support for this propagation behavior is spotty at best. Consult the documentation for your resource manager to determine if nested transactions are supported.

PROPAGATION_NEVER

Indicates that the current method should not run within a transactional context. If there is an existing transaction in progress, an exception will be thrown.

PROPAGATION_NOT_SUPPORTED

Indicates that the method should not run within a transaction.If an existing transaction is in progress, it will be suspended for the duration of the method. If using JTATransactionManager, access to TransactionManager is required.

PROPAGATION_REQUIRED

Indicates that the current method must run within a transaction.If an existing transaction is in progress, the method will run within that transaction. Otherwise, a new transaction will be started.

PROPAGATION_REQUIRES_NEW

Indicates that the current method must run within its own transaction. A new transaction is started and if an existing transaction is in progress, it will be suspended for the duration of the method. If using JTATransactionManager,access to TransactionManager is required.

PROPAGATION_SUPPORTS

Indicates that the current method does not require a transactional context, but may run within a transaction if one is already in progress.

原创粉丝点击