Meaningless Drivel is fun!*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes EJB Transactions Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "EJB Transactions Query" Watch "EJB Transactions Query" New topic

EJB Transactions Query

Alka Sharma

Joined: Sep 02, 2002
Posts: 16
Here is a question from Epractize mock exam.

ATMEJB has a method withdrawal() with required transaction attribute and is calling AccountEJB method getAmount(). At the same time, ChequeProcessorSessionEJB is calling getAmount() method of AccountEJB without any transaction context.

The alogorithm for getAmount() is to deduct the amount from account balance, calculate interest, update history and return the requested amount to the caller.

Question : What best describes the AccountEJB component?

a) AccountEJB should be stateless seesion EJB with RequiresNew transaction attribute for getAmount()
b) AccountEJB should be implemented as BMP with Required transaction attribute for getAmount()
c) AccountEJB should be implemented as CMP with Supports transaction attribute for getAmount()
d) AccountEJB should be implemented as CMP with RequiresNew transaction attribute for getAmount()

The correct answer mentioned is d)

But I am not convinced with RequiresNew transaction attribute for getAmount() as if getAmount() method is executed successfully but withdrawal() method fails, still the amount will be deducted from customer's account.

In my understanding Required should be the transaction attribute, but i don't see any need for BMP here.

Please comment.

- Tinu
Santiago Urrizola
Ranch Hand

Joined: Apr 27, 2006
Posts: 172
i think required should be transaction attribute.

Santiago Urrizola : La Plata - Argentina<br />SCEA (89%-92%)<br /><a href="" target="_blank" rel="nofollow"></a>
jQuery in Action, 2nd edition
subject: EJB Transactions Query
Similar Threads
long post IBM.158
doubt in ejb transaction
doubts in mock exam questions.
Design Pattern: Confusing Questions !! Please help in answering....
ICE 287 answers for WebSphere 5.0