Spring DataSourceTransactionManager是否支持REQUIRES_NEW?

时间:2018-10-29 03:52:34

标签: java spring spring-transactions

我这样测试“春季交易传播”:

fun A(){
  funB()
}
ClassA.fun A:REQUIRED 
ClassB.fun B:REQUIRES_NEW
transactionManager: DataSourceTransactionManager

它运行正常,即:DataSourceTransactionManager支持事务传播“ REQUIRES_NEW”。

但是org.springframework.transaction.jta.JtaTransactionManager(spring-tx-4.3.14.RELEASE.JAR)的描述显示:

 * <p><b>Transaction suspension (REQUIRES_NEW, NOT_SUPPORTED) is just available with a
 * JTA TransactionManager being registered.</b> Common TransactionManager locations are
 * autodetected by JtaTransactionManager, provided that the "autodetectTransactionManager"
 * flag is set to "true" (which it is by default).

谁能告诉我哪个是对的?

0 个答案:

没有答案