spring try catch 手动事物回滚


方法上加注解  @Transactional

        try {
            // code
        } catch (Exception e) {
            //事物回滚
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
        }

# java   spring  

评论

企鹅群:39438021

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×