Sprint @Transnational is being ignored in the following cases:
1. when the caller method is calling the @Transaction annotated method from the same class
2. When the Annotated method is not public
@Transnational by default don't rollback for Checked Exceptions
class A{ void caller(){ doInTransactionMethod(); // @Transnational is ignored } @Transnational // by default rollback for RuntimeExceptions public <return type> doInTransactionMethod(<params>){ // should be public as well } }
The problem is, I keep forgetting about the above 3 simple rules, So I tried to writing down here to try not to forget about it
http://m-hewedy.blogspot.com/search?updated-max=2019-01-01T07:27:00%2B02:00&max-results=7
本博客文章绝大多数为原创,少量为转载,代码经过测试验证,如果有疑问直接留言或者私信我。
创作文章不容易,转载文章必须注明文章出处;如果这篇文章对您有帮助,点击右侧打赏,支持一下吧。
创作文章不容易,转载文章必须注明文章出处;如果这篇文章对您有帮助,点击右侧打赏,支持一下吧。