GeeCON Prague 2014*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes jdiscuss question 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 "jdiscuss question" Watch "jdiscuss question" New topic
Author

jdiscuss question

preethi bhat
Greenhorn

Joined: Sep 28, 2004
Posts: 5
i cannot solve this question
http://jdiscuss.com/Enthuse/jsp/ShowAvailableTests.jsp
Test - 3
Question - 2
(sorry for the inconvinience i cannot paste it as it has figures)

can some one explain the basic principle.
Anshul puri
Greenhorn

Joined: Dec 09, 2004
Posts: 2
The question has to do with the transaction attributes for methods in a CMT bean.

methodA : RequiresNew
methodB : Required
methodC : NotSupported
methodD : RequiresNew

methodA calls methodB. methodB calls methodC and methodD.

1. methodA runs in TxA.

2. Since methodB's transaction attribute is Required and it is called from methodA with an existing transaction context TxA, methodB runs in that existing transaction of TxA.

3. methodC's transaction attribute is NotSupported and it is called from methodB. Since there is an existing transaction TxA for methodB, the context for the caller method (methodB) will be suspended in this case and methodC will run in an "unspecified transaction context" .

4. methodD's transaction attribute is RequiresNew and it is called from methodB. Since there is an existing transaction TxA for methodB, the caller's (methodB) transaction TxA gets suspended, and methodD will run with a new transaction TxD.


So, the correct answer is :
methodA (TxA) --> methodB (TxA)
methodB (TxA) --> methodC (no transaction context)
methodB (TxA) --> methodD (TxD)
preethi bhat
Greenhorn

Joined: Sep 28, 2004
Posts: 5
thank u Anshul
 
GeeCON Prague 2014
 
subject: jdiscuss question