事物Spring boot @Transactional
事物:dr
@Override
@UDS(value="fq")
@Transactional
public BaseResultMessage testTransactional(){
BaseResultMessage rm = Utils.baseDefaultResultMessageSuccess();
TestEntity test = new TestEntity();
test.setId(5);
test.setName("x");
int i = otherOrderInMapper.insetTest(test);
try{
int m=10/0;
}catch (Exception e) {
logger.error("==> 异常回滚!");
rm.setType(false);
rm.setMsg(" 异常回滚");
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return rm;
}