Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BMT problem

 
Jayashree Mohan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which two are true about bean-managed transaction demarcation?

A) A transaction used by a BMT bean MUST have been started by the bean.
B) The caller's transaction will be propogated into a BMT bean.
C) Transactions in a BMT bean do not propogate when the BMT bean calls
a method on another bean.
D) A bean cannot use both CMT and BMT together.
E) BMT beans must not specify transaction attributes

a,c,d and e seem to be true to me?Which are the 2 correct answers?
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you. Where does this question come from?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you think that a,c,d and e are true?
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know why Jayashree thinks they're true, but for me:

A. Transactions don't propagate into BMT beans, so if it's using a transaction, then it must have started it.

C. Oops, not true. Transactions can propagate from BMT beans, just not to them.

D. Beans must be marked either BMT or CMT.

E. Not sure about this one actually. The transaction attributes (REQUIRED, MANDATORY, SUPPORTED, etc.) only really make sense for CMT. I suppose you could mark them for BMT though. I never really thought about it.

So if I had to choose only two, I'd go for A and D.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
E. Not sure about this one actually. The transaction attributes (REQUIRED, MANDATORY, SUPPORTED, etc.) only really make sense for CMT. I suppose you could mark them for BMT though. I never really thought about it.

According to the EJB spec:

There is no mechanism for an Application Assembler to affect enterprise beans with bean-managed transaction demarcation. The Application Assembler must not define transaction attributes for an enterprise bean with bean-managed transaction demarcation.
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All right, so we're down to A and D. Which one should we throw out, or is the question wrong?
 
Sub swamy
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arent A, D ,E true in the above ?
a) true - since BMT beans do not participate in the propogated transaction
d) true
e) true - as per spec.
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes. A, D and E are right
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic