同一个类中无事务方法a()内部调用有事务方法b()的问题
买泛域名SSL证书 送5斤装现摘猕猴桃一箱、同时提供技开源商城搭建免费技术支持。
泛域名ssl证书 239元1年送1个月、单域名39元1年,Sectigo(原Comodo证书)全球可信证书,强大的兼容性,高度安全性,如有问题7天内可退、可开发票
加微信VX 18718058521 备注SSL证书
【腾讯云】2核2G4M云服务器新老同享99元/年,续费同价
泛域名ssl证书 239元1年送1个月、单域名39元1年,Sectigo(原Comodo证书)全球可信证书,强大的兼容性,高度安全性,如有问题7天内可退、可开发票
加微信VX 18718058521 备注SSL证书
【腾讯云】2核2G4M云服务器新老同享99元/年,续费同价
public class PropagationTest extends BaseServerTest { private static final Logger logger = Logger.getLogger(PropagationTest.class); @Test @Transactional() public void a() { try { PropagationTestB classb = new PropagationTestB(); classb.b(); } catch (Exception e) { throw new RuntimeException(); } } } class PropagationTestB { @Autowired TRSMapper trsMapper; @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false, rollbackFor = RuntimeException.class) public void b() { try { trsMapper.saveNews(new JSONArray()); } catch (Exception e) { throw new RuntimeException(); } } }
public class PropagationTest extends BaseServerTest { private static final Logger logger = Logger.getLogger(PropagationTest.class); @Autowired TRSMapper trsMapper; @Test public void a() { try { b(); } catch (Exception e) { throw new RuntimeException(); } } @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false, rollbackFor = RuntimeException.class) public void b() { try { trsMapper.saveNews(new JSONArray()); } catch (Exception e) { throw new RuntimeException(); } } }