在springboot应用程序的服务层中,从一个事务中进行两个DAOImpl调用

时间:2018-09-13 20:17:53

标签: spring-boot jdbctemplate transactional

例外: JTA事务意外回滚(可能是由于超时);嵌套的异常是weblogic.transaction.RollbackException:在交易中调用setRollbackOnly

我的代码:     @Override     @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)     公共无效updateBEmployee(长interfaceId,字符串jsonObj,字符串cmIds,字符串url)             {         transactionTemplate.execute(new TransactionCallbackWithoutResult(){             受保护的void doInTransactionWithoutResult(TransactionStatus status){                 尝试{                     bDAO.updateBackgroundInterfaceXMLResponse(interfaceId,jsonObj);                     bDAO.updateCustomerEmployeeLinkSent(url,cmIds);                 } catch(Exception e){                     status.setRollbackOnly();                 }
            }         });     }

0 个答案:

没有答案