在Service层或DAO层添加Transactional标签: @Transactional(readOnly = false, rollbackFor = xxException.class) 可加在类上或者方法上