Spring注解 @Transactional(rollbackFor = Exception.class)

Spring事务注解@Transactional(rollbackFor = Exception.class)

作用是:当方法中抛出异常时,事务回滚,取消原来对数据库的改动。

posted @ 2018-04-13 09:10  mithrandirw  阅读(1031)  评论(0编辑  收藏  举报