spring 手动抛异常并让事务回滚

    try
    {
      throw new Exception("test exception!");
    }
    catch ( Exception e )
    {
      e.printStackTrace();
      TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //事务回滚
    }

展开阅读全文

没有更多推荐了,返回首页