这是json声明
var ioc = {
$aop : {
type : 'org.nutz.ioc.aop.config.impl.ComboAopConfigration',
fields : {
aopConfigrations : [{
type : 'org.nutz.ioc.aop.config.impl.JsonAopConfigration',
fields : {
itemList : [
["com.wonders..+At$", "[^(saveBizLog|getPrivate*)]", "ioc:monitor"],
["com.wonders..+Manage$", "(add|insert).+", "ioc:txREAD_COMMITTED"],
["com.wonders..+Manage$", "(save|update|delete|remove|clear).+", "ioc:txSERIALIZABLE"],
["com.wonders..+Module$", ".+", "ioc:txREAD_COMMITTED"],
["com.wonders..+manage$", "(add|insert).+", "ioc:txREAD_COMMITTED"],
["com.wonders..+manage$", "(save|update|delete|remove|clear).+", "ioc:txSERIALIZABLE"],
["com.wonders..+service$", "(add|insert).+", "ioc:txREAD_COMMITTED"],
["com.wonders..+service$", "(save|update|delete|remove|clear).+", "ioc:txSERIALIZABLE"],
]
}
要执行的方法位于如下位置
package com.wonders.biz.salvation.common.manager;
public class InitDataManager
{
@Inject
Dao dao;
@Inject
MongoDBService mongoDBService;
public String add(JzEventVO jzEventVO, List<JzEventPersonVO> jzEventPersonVOList){String[] jzBussId ={""}; //事件编号
JzEventBO jzEventBO = new JzEventBO();
BeanUtils.copyProperties(jzEventVO, jzEventBO);
//校验事件实体
if( !validteEventBO(jzEventBO) )
return "";
//插入事件实体
dao.insert(jzEventBO);
System.out.println("事件id:"+jzEventBO.getJzBussId());
//得到事件ID
jzBussId[0] = jzEventBO.getJzBussId();
String personId = ""; //户主人员编号
//遍历
for(JzEventPersonVO jzEventPersonVO: jzEventPersonVOList)
{
JzEventPersonBO jzEventPersonBO = new JzEventPersonBO();
BeanUtils.copyProperties(jzEventPersonVO, jzEventPersonBO);
jzEventPersonBO.setJzBussId(jzBussId[0]);
//插入
dao.insert(jzEventPersonBO);
//得到户主的人员编号
if("01".equals(jzEventPersonBO.getRelation()))
personId = jzEventPersonBO.getJzEventPersonId();
}
//找不到户主,回滚事务
if("".equals(personId))
throw new RuntimeException("找不到户主,即人员实体relation为空!");
jzEventBO.setBasicObjId(personId);
//更新事件实体
dao.update(jzEventBO);
return jzBussId[0];}
就这个add方法 我打断点 第一个insert语句存入成功,然后抛了异常,没有回滚,数据库仍然存在那条数据