Page 1 of 1

About Question enthuware.oce-ejbd.v6.2.467 :

Posted: Wed Aug 14, 2013 6:32 am
by kdmandawe
Hi,
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?

Code: Select all

        <container-transaction>   
             <method>      
                 <ejb-name>MySessionBean</ejb-name>      
                 <method-name>*</method-name>   
            </method>   
            <trans-attribute>NotSupported</trans-attribute> 
         </container-transaction>
Sorry, I got confused... :?

Thanks in advance!
Kenneth

Re: About Question enthuware.oce-ejbd.v6.2.467 :

Posted: Wed Aug 14, 2013 7:17 am
by admin
No, it will not override but if the bean doesn't specify it for a method then the one specified in DD will apply.
-Paul.

Re: About Question enthuware.oce-ejbd.v6.2.467 :

Posted: Wed Aug 14, 2013 7:28 am
by kdmandawe
That confuses me the more.

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

Re: About Question enthuware.oce-ejbd.v6.2.467 :

Posted: Wed Aug 14, 2013 7:32 am
by kdmandawe
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.

Re: About Question enthuware.oce-ejbd.v6.2.467 :

Posted: Wed Aug 14, 2013 8:09 am
by admin
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.

Re: About Question enthuware.oce-ejbd.v6.2.467 :

Posted: Wed Aug 14, 2013 8:24 am
by kdmandawe
No problem Paul. Kindly just correct what needs to be corrected to avoid confusion.

Best regards,
Kenneth

Re: About Question enthuware.oce-ejbd.v6.2.467 :

Posted: Wed Aug 14, 2013 11:57 am
by admin
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.