2

spring 事务问题

 2 years ago
source link: https://www.v2ex.com/t/813324
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Java

spring 事务问题

  kikione · 2 天前 · 1316 次点击

两个 Service A 的方法 A 没有加 @Transactional 和 Service B ;

Service A 的方法 A 没有加 @Transactional

Service B 的方法 B 添加 @Transactional

方法 A 调用方法 B ,方法 B 出错,抛出全局异常,

为什么会去回滚到 controller 里,再执行一次。

相当于 B 抛出全局异常后, 这个接口执行了两遍

第 1 条附言  ·  2 天前

两个 Service A 和 Service B ;

第一句

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK