Remember that values in XML deployment descriptor always override the values specified in annotations (except structural information such as bean type and transaction attributes, which cannot be changed by the deployment descriptor.)
Is this not transaction attribute which is overriden by the specified XML DD in the question?
If it won't override, then how come option 3 'Both the methods, method1 and method2, may be invoked from a client with a transaction-context and no exception will be thrown.' is the right answer? How come the DD 'NOT_SUPPORTED' is assumed(annotation REQUIRES_NEW overridden)?
The explanations you provided in the test studio say that the xml overrides the transaction attributes of all the methods of the bean. That is very contradicting to your previous post above.
You are right, it seems this question is messed up. I need to contact the author to figure out what is going on. I will get back to you shortly and I apologise for the trouble.
-Paul.
If you like our products and services, please help us by posting your review here.
It seems the question and the explanation both are correct. The issue is with the examples of "structural information". I updated this and a few other questions with the example a few days ago and I messed them up. What I should have written was "transaction management type" but I wrote "transaction attributes".
As per Section 19.3, transaction attributes can be overridden by the DD. Transaction Management type (i.e. whether it uses a CMT or BMT) cannot be overridden by the DD.
Again, I apologise for this confusion.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.