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

Moderator: admin

Post Reply
kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

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

Post 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

admin
Site Admin
Posts: 10045
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

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

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

kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

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

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

admin
Site Admin
Posts: 10045
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

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

Post by kdmandawe »

No problem Paul. Kindly just correct what needs to be corrected to avoid confusion.

Best regards,
Kenneth

admin
Site Admin
Posts: 10045
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests