Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Enthuware question doubt

 
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 !
 
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 !
 
permaculture is giving a gift to your future self. After reading this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic