How do I prevent exceptions from causing a transaction rollback under Grails?

前端 未结 2 1786
渐次进展
渐次进展 2021-02-05 14:09

My Grails service is having an issue where a swallowed exception unrelated to a transaction is causing the transaction to rollback even when it is unrelated to the persistance o

2条回答
  •  青春惊慌失措
    2021-02-05 15:07

    In addition to @Burt Beckwith's answer, if you have a service where you just don't want transactions (which I actually did in my case) you can turn off transactions on all public methods by adding

    static transactional = false
    

    to the Service class.

提交回复
热议问题