aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Enthuware question doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Enthuware question doubt" Watch "Enthuware question doubt" New topic
Author

Enthuware question doubt

Lee Kian Giap
Ranch Hand

Joined: Jan 23, 2008
Posts: 210
com.enthuware.ets.scbcd.v5.2.157




(A) A new transaction will be started for method1() even if the client calls it within a transaction.
(B) Calling method1() within a transaction will cause an exception to be thrown.
(C) Both the methods, method1 and method2, may be invoked within a transaction and no exception will be thrown.
(D) None of these.

The correct answer given is (C)
explanation given is:
The existing transaction will be suspended because of NOT_SUPPORTED.



My answer is (D)
Since both method1 and method2 is now having Transaction Attribute NOT_SUPPORTED,
If client is running under its transaction context, when calling method1/method2, the client transaction is suspended and thus method1/method2 will not running in transaction context
If client is not running under its transaction context, when calling method1/method2, no new transaction will be created and thus method1/method2 will not running in transaction context


May I know what is your answer and explanation ? Thanks !


SCJP 6, SCWCD 5, SCBCD 5
Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

Lee Kian Giap wrote:com.enthuware.ets.scbcd.v5.2.157




(A) A new transaction will be started for method1() even if the client calls it within a transaction.
(B) Calling method1() within a transaction will cause an exception to be thrown.
(C) Both the methods, method1 and method2, may be invoked within a transaction and no exception will be thrown.
(D) None of these.

The correct answer given is (C)
explanation given is:
The existing transaction will be suspended because of NOT_SUPPORTED.



My answer is (D)
Since both method1 and method2 is now having Transaction Attribute NOT_SUPPORTED,
If client is running under its transaction context, when calling method1/method2, the client transaction is suspended and thus method1/method2 will not running in transaction context
If client is not running under its transaction context, when calling method1/method2, no new transaction will be created and thus method1/method2 will not running in transaction context


May I know what is your answer and explanation ? Thanks !


I do not see anything wrong...
I think you misunderstand question.

Yes the methods can indeed be called without an exception being thrown if client is in a transaction. So c is not wrong.


SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
Lee Kian Giap
Ranch Hand

Joined: Jan 23, 2008
Posts: 210
yes, you are right, I misunderstand question the.


I have pass the exam today with 81% today ~

Thank a lot !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enthuware question doubt
 
Similar Threads
EJB Notes I prepared during my preparation for SCBCD
Doubt in Transanction Attributes
Remove method inside transaction for stateful bean
EJB and Transactions
UserTransaction in CMT