Annotation @Transactional. How to rollback?

后端 未结 4 1977
长情又很酷
长情又很酷 2020-11-28 02:53

I used this annotation successfully for a Dao class. And rollback works for tests.

But now I need to rollback real code, not just tests. There are special annotatio

4条回答
  •  时光说笑
    2020-11-28 03:12

    or programatically

    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
    

提交回复
热议问题