• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Himai Minh

CMTs in EJB 2.0

Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which two are true about container managed transactions in EJB 2.0? Select all 2 correct Choices.

A.Differentiating between overloaded methods is possible in the bean's deployment descriptor.
B.A transactional attribute must be individually declared in the method-name tag, for every business method in the bean class.
C.The container will interpose only on method invocations with container-managed transaction demarcation.
D.If an 'onMessage' method returns before committing a transaction the container will throw an exception.
E.A message-driven bean with CMT demarcation must not invoke the EJBContext.getUserTransaction method.

My answers:A,D,E
JPilot answers:A,E

Is D a correct option.I think container throws an exception if the onMessage method returns with out comitting a transaction.what does actually happen?can any one tell?

thanks in advance

SCJP 1.4,SCWCD 1.4
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Remeber MDB's don't have a client asociated to it,so if there is an exception who will the container throw it to? instead it doesnt throw the exception but the message on which the container is acting gets back in the end of the queue. With CMT that mesages keeps coming to be processd but not for ever as most of the messaging services can be either configured or come with a default setting of how many times the msg can be processed b4 it is throwm in some other say bad message queue. With the BMT you are still not alowed to throw any exception(onMessage() doesnt throw exceptions) but u can write your method in such a way that you can rollback the transaction and still complete the method and make the container feel that its done with it.

Hope this helps.

[ October 12, 2004: Message edited by: Nileesha Bojjawar ]
For my next trick, I'll need the help of a tiny ad ...
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic