事务中不影响功能的方法异常设置为不回滚

spring框架,执行一个方法,不影响功能的报错影响整体事务,报错如下:
org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
回滚异常,被标记为仅回滚

解决方法:
globalRollbackOnParticipationFailure设置为false


    
    
     

参考:https://www.iteye.com/blog/jsczxy2-1773795

你可能感兴趣的:(java,spring)