NutzCN Logo
问答 ntuz事务嵌套,被嵌套的所有类,再执行当中遇到错误,全部回滚怎么配置json格式的?
发布于 2932天前 作者 mingkaili 1751 次浏览 复制 上一个帖子 下一个帖子
标签:

我现在配置的如下:
var ioc = {
transaction : {
type : 'org.nutz.aop.interceptor.TransactionInterceptor'
},
//声明一个log进行日志记录
log : {
type :'org.nutz.aop.interceptor.LoggingMethodInterceptor'
},
//repeatsubmit : {
// type :'com.uucin.uumall.interceptor.RepeatSubmitInterceptor'
//},
$aop : {
type : 'org.nutz.ioc.aop.config.impl.ComboAopConfigration',
fields : {
aopConfigrations : [
{type : 'org.nutz.ioc.aop.config.impl.JsonAopConfigration',
fields : {
itemList : [
['com\.mxlvniao\.lvniao\..+','.+','ioc:transaction']
]
}
},
{type : 'org.nutz.ioc.aop.config.impl.AnnotationAopConfigration'}
]
}
}
}

1 回复

这个跟怎么配置没什么关系,事务只认最外面一层(内置的事务实现),所以,只要最外面的方法抛出异常(无论该异常是该方法产生的还是调用其他方法产生),就会回滚。

注意用词,是抛出,不能被catch。

添加回复
请先登陆
回到顶部