Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Question about Transactions

 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

A Mock question in relation with my recent post http://www.coderanch.com/t/163269/java-EJB-SCBCD/certification/Message-Driven-Bean-TransactionAttribute

Which statements about transaction attributes and propagation is correct?
A- A message-driven bean's listener methods can only have a REQUIRED, REQUIRES_NEW, or NOT_SUPPORTED transaction attribute.
B- An enterprise bean's timeout callback method can only have a REQUIRED, REQUIRES_NEW, or NOT_SUPPORTED transaction attribute.
C- An enterprise bean implementing the javax.ejb.SessionSynchronization interface can only have a REQUIRES or REQUIRES_NEW transaction attribute.
D- A session bean's business method cannot have a MANDATORY transaction attribute.

I know that A is false (spec 13.3.7) but I don't understand why MDB can't have attribute REQUIRES_NEW.

Any help ?
Thanks,

Beno�t
 
Mateusz Maksymiuk
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A: NO (MDB can have only REQUIRED or NOT_SUPPORTED)
B: YES
C: NO (SFSB with SessSynch. can have REQUIRED, REQUIRES_NEW or MANDATORY)
D: NO (totally wrong)

Because REQUIRES_NEW would be the same as REQUIRED.
MDB don't recive a client TX context.
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, it is RequiresNew, not REQUIRES_NEW.
Edit: my mistake, i guess my remark only applies to EJB 2.0
I am not aware of the EJB 3.0 specifications yet.
[ November 17, 2007: Message edited by: Celinio Fernandes ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic