在具有propagation
传播的现有交易中,如here所述以编程方式(使用PlatformTransactionManager
调用交易(使用REQUIRED
)时,应用哪种类型的NESTED
?是REQUIRED
还是传播DefaultTransactionDefinition def = new DefaultTransactionDefinition();
// explicitly setting the transaction name is something that can only be done programmatically
TransactionStatus status = txManager.getTransaction(def);
try {
// execute your business logic here
}
catch (MyException ex) {
txManager.rollback(status);
throw ex;
}
txManager.commit(status);
的逻辑事务?
经过this question后,似乎是后者。
示例代码:
{{1}}
如何从交易状态中查找传播行为和隔离级别?有办法吗?