The sence about Transaction in Spring

yunchat發表於2010-12-14

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章