Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enthuware question doubt

 
Lee Kian Giap
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !
 
Yucca Nel
Ranch Hand
Posts: 147
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lee Kian Giap
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, you are right, I misunderstand question the.


I have pass the exam today with 81% today ~

Thank a lot !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic