任何机构都可以提供一些见解..
我一直很难过,而且经历过 spring @Transactional(Propagation Nested)
我一直在网上和这里搜索,但无法找到关于此的特定类型的任何通用示例..
@Transactional(required)
mtdOne(User userObj1, User userObj2)
{
someBean.mtdtwo( userObj1);
someBean.mtdThree(userObj2);
}
@transactional(nested)
mtdTwo(userObj1)
{
//calling dao and insert data into DATABASE
daoObj.save(userObj1);
//this data must not be rolled back,
// even though exception thrown in next method
}
@transactional(required)
mtdThree(userObj2)
{
//calling dao second time and insert data into DATABASE
daoObj.save(userObj2);
/////Some Exception thrown here
}
所以我想将methodTwo数据保存到DB中,不能回滚 即使在下一个方法中抛出异常..
我希望使用交易(嵌套)
来实现此目的请给我任何建议..