您的位置:首页 > 编程语言 > Java开发

Spring 事务传播属性

2009-07-08 15:48 176 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: