Win a copy of liveProject: Build an ML Recommender System this week in the Artificial Intelligence and Machine Learning 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Transaction Scenario Question (Help)

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
The following is an question I found on scea_j2ee forum.
There are two Enterprise Java Beans, A and B. A
method in "A" named "Am" begins execution, reads a
value v from the database and sets a variable
"X" to value v, which is one hundred. "Am" adds fifty to the variable X and updates the database with the new value of X. "Am" calls "Bm", which is
a method in B. "Bm" begins executing. "Bm" reads an additional value from the database. Based on the value, "Bm" determines that a business rule has been violated and aborts the transaction. Control is returned to "Am".
Requirement:
If "Bm" aborts the transaction, it is imperative that the original value be read from the database and stored in variable X.
Given the scenario above, which Transaction Attributes will most likely meet the requirements stated?
a A-RequiresNew, B-Mandatory
b A-Mandatory, B-RequiresNew
c A-RequiresNew, B-Supports
d A-NotSupported, B-RequiresNew
e A-RequiresNew, B-RequiresNew
I have 2 questions :
1. Which is the most correct answer for abvoe question ?
2. In SCEA part I exam, do they ask similar kind of question ?
I have studied EJB but I do not have any idea of taste of questions in exam.
I'd be highly thankful if some body can come up with 1 sample question of each objectives.
Thanx in Anticipation.
Sandeep.
 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMHO
#1 A and C
#2 Yes they do.
#3 Ian has a nice exam.
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sandeep,
You can get scenarion questions like this. In such situations, take your time to understand the problem. Answer by eliminating the most improbable ones. Then you have the task easier.
For eg, in the problem you mentioned the requirement is " "Bm" aborts the transaction, it is imperative that the original value be read from the database and stored in variable X."
This implies,
1) Am is running under a transaction context
2) Am and Bm should be in the same transaction.
Now look at the answers:
Eliminate answers which state "Not Supported" or "Never" as transaction attribute (see point 1 above)
Eliminate those which specify "Requires New" for Bm. ( see point 2 above)
Now you are left with 2 choices. Analyse them.
If Am has "Requires new" it doesnot matter whether Bm has txn attribute as "Mandatory" or "Supports"
So the answer is A and C.
(Good Luck)
regards
sangam
 
What are you doing in my house? Get 'em tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic