| Author |
HFE page 567-5
|
bird cao
Ranch Hand
Joined: Feb 14, 2004
Posts: 43
|
|
|
why?
|
 |
Anthony Watson
Ranch Hand
Joined: Sep 25, 2003
Posts: 327
|
|
If methodA has a transaction attribute of RequiresNew, Never, or NotSupported, then it will not use an existing transaction of the calling methodB. MethodB only cares about a TransactionRolledbackException if its transaction is rolled back. In the above cases, methodB will not care about the status of methodA's transaction (if it is running in one). If methodA has a transaction attribute of Madatory, then it must run in methodB's existing transaction. If methodA throws a system exception, the container will automatically roll back the transaction started by methodB. MethodB definitely cares about this and so it will receive a TransactionRolledbackException.
|
Anthony W.<br />MCP, SCJP 1.4, SCJD, SCWCD 1.3, SCWCD 1.4, SCBCD
|
 |
 |
|
|
subject: HFE page 567-5
|
|
|