is there a way to force a transactional rollback without encountering an exception?

后端 未结 8 1979
鱼传尺愫
鱼传尺愫 2020-12-13 00:34

I have a method that does a bunch of things; amongst them doing a number of inserts and updates. It\'s declared thusly...

@Transactional(propagation = Propag         


        
8条回答
  •  庸人自扰
    2020-12-13 00:45

    This works for me:

    TransactionInterceptor.currentTransactionStatus().setRollbackOnly();
    

提交回复
热议问题