• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mock Question about Transactions

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

A Mock question in relation with my recent post https://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
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic