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?
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.