noRollbackFor not always working on unchecked exceptions (not a duplicate)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've seen a lot of similar questions but they are usually just tangential to mine. Here is my code. @Override //class implements interface //can also add "rollbackFor = OutOfMemoryError.class" here, to no avail @Transactional(noRollbackFor = IllegalArgumentException.class) public ReportTemplate getByCode(final String code) //throws IllegalArgumentException - see question text { if(code == null) { throw new IllegalArgumentException("ss"); } } Consumer (non-transactional) calls this method via autowired interface. Despite noRollbackFor the