It's not a secret anymore!
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFE page 567-5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HFE page 567-5" Watch "HFE page 567-5" New topic

HFE page 567-5

bird cao
Ranch Hand

Joined: Feb 14, 2004
Posts: 43
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
I agree. Here's the link:
subject: HFE page 567-5
It's not a secret anymore!