捕获异常后手动开启回滚事务
@Transactional(rollbackFor = { Exception.class })
public String fun() {
String result ="";
try {
throw new ServiceException();
} catch (Exception e) {
logInfo
//手动开启事务回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return result;
}