spring3+mybatis事务不回滚解决方法
spring3+mybatis事务不回滚Java codepublic void createMemberAccount(TbMemberAccount account,TbRegiste
spring3+mybatis事务不回滚
Java codepublic void createMemberAccount(TbMemberAccount account, TbRegisterActive active) { this.accountMapper.insertMemberAccount(account); memberId = account.getMemberId().longValue(); active.setMemberId(memberId.intValue()); active.setEmailAddress(null); this.activeMapper.insertRegisterActive(active);}
首先是insertMemberAccount(account)成功
然后active.setEmailAddress(null);表中该字段不能为空所以insertRegisterActive(active);抛出异常
但是insertMemberAccount(account)还是插入成功没有回滚事务
[解决办法]楼主先看下Spring事务配置的地方和网上的资料对比下,尤其是createMemberAccount方法是否属于pointcut,如果使用的是注解,该类是否加上相关注解。希望能帮上楼主忙。