How to check if a @transactional method perform rollback correctly in Grails?

こ雲淡風輕ζ 提交于 2019-12-11 18:03:27

问题


Let's say we have a code like the following (I got the code frome here):

@Transactional
private def unitaryOperationUpdate {

    Integer roleId = params.roleSelector.toInteger()
    def roleInstance = Role.findById(roleId)
    UserRol.removeAll userInstance
    UserRol.create userInstance, roleInstance
}

If some error happened between removeAll and create, how could we check ourselves if the rollback is working properly?

来源:https://stackoverflow.com/questions/18548026/how-to-check-if-a-transactional-method-perform-rollback-correctly-in-grails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!