zoukankan      html  css  js  c++  java
  • 事物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;
    }

  • 相关阅读:
    五一集训——图论
    Luogu P3942 将军令
    8.14 Round 1
    8.10 Round 1
    8.9 Round 1
    8.7 Round 2
    8.7 Round 1
    8.6 Round 1
    8.5 Round 2
    FHQ-Treap
  • 原文地址:https://www.cnblogs.com/gzhbk/p/11341154.html
Copyright © 2011-2022 走看看