topmeng
topmeng
2010-11-29 16:32

spiring 事务 PROPAGATION_REQUIRES_NEW

  • spring

外事务A为PROPAGATION_REQUIRED,嵌套事务为一个循环B为PROPAGATION_REQUIRES_NEW.

[code="java"]function A{
for(...){
funciton B(
save();
);
}
}[/code]
为什么不能每次循环保存到数据库中,而是只有当A事务执行完后,B中的才可保存到数据空中?
[code="java"] class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
abstract="true">



PROPAGATION_REQUIRED,readOnly
PROPAGATION_REQUIRED,readOnly

PROPAGATION_REQUIRED,-Exception


PROPAGATION_REQUIRED,-Exception


PROPAGATION_REQUIRED,-Exception


PROPAGATION_REQUIRED,-Exception

PROPAGATION_REQUIRED,-Exception

PROPAGATION_REQUIRED,-Exception


PROPAGATION_REQUIRES_NEW,-Exception


[/code]

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐