Spring Transactional Management PROPAGATION_REQUIRED,ISOLATION_DEFAULT

时间:2015-03-18 08:58:36

标签: java spring

我有以下日志,我是否需要考虑此错误? 我的交易配置有问题吗?

使用Spring 3.1.1

[DEBUG]-2015-03-17 14:45:18,957 DataSourceTransactionManager: Creating new transaction with name [com.mydao.updateUserInfo]: 
PROPAGATION_REQUIRED,ISOLATION_DEFAULT; '',-java.lang.Exception

2 个答案:

答案 0 :(得分:2)

此字符串以toString()类的DefaultTransactionDefinition方法构建。根据文档,toString()方法生成事务定义的描述,格式与org.springframework.transaction.interceptor.TransactionAttributeEditor匹配。

TransactionAttributeEditor以下列格式生成字符串

  

PROPAG_NAME_NAME,ISOLATION_NAME,readOnly,   timeout_NNNN,+ Exception1,-Exception2

     

A" +"在异常名称substring指示事务之前   即使抛出此异常,也应该提交; a" - "他们应该   回滚

答案 1 :(得分:1)

为什么你认为有错误?

该行只跟踪使用它的配置创建transactionManager。此处打印的java.lang.Exception可能是rollbackFor参数的值(异常类型将在发生时触发事务回滚)。例外是此处的默认值。