• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMTs in EJB 2.0

srinija kosaraju
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • 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 ]
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!