ITPub博客

首页 > 应用开发 > Java > The sence about Transaction in Spring

The sence about Transaction in Spring

原创 Java 作者:yunchat 时间:2010-12-14 13:11:36 0 删除 编辑

Some sence are strange in our project. I should make note.

Has following methods:

ClassA.methodA -- no tranaction

ClassA.methodB -- tranaction REQUIRES

ClassC.methodC -- tranaction REQUIRES

ClassC.methodD -- tranaction REQUIRES_NEW

1. When calls methodB from methodA. the tranaction doesn't work.

2When calls methodB from methodC the tranaction works.

3 When calls methodD from methodB the requires_new doesn't work. it doen't use the new tranaction.

4 the requires_new will create the new session. please make sure you need to use requires_new.

Are the sences above the same are you think?

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/118026/viewspace-1043073/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    32
  • 访问量
    955730