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!!