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

Moderator: admin

Post Reply
renatumb
Posts: 47
Joined: Mon Apr 08, 2013 7:55 pm
Contact:

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

Post by renatumb »

On explanation is mentioned:
" ...deployment descriptor values always override annotation values (except structural information such as bean type ... "
If a bean has the following code:

Code: Select all

@javax.ejb.Stateful
public class x019_Teste{
}

and the following DD

Code: Select all

<enterprise-beans>
        <session>
            <ejb-name>x019_Teste</ejb-name>
            <ejb-class>pkg001.x019_Teste</ejb-class>
            <session-type>Stateless</session-type>
        </session>
<enterprise-beans>
Which will its type be? Stateless of Stateful ?
Based on explanation above, it will be a STATEFUL ...but on Glash Fish, it is a STATELESS
So... what should I consider for the exam?

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

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

Post by admin »

Glassfish is wrong. As per section 19.2:
Structural information describes the structure of an enterprise bean and declares an enterprise bean’s external dependencies. Providing structural information for the ejb-jar/.war file producer. Structural information may be provided using metadata annotations in the beans’ code or in the deployment descriptor. The structural information cannot, in general, be changed because doing so could break the enterprise bean’s function.

If the bean’s type has been specified by means of the Stateless, Stateful, Singleton, or MessageDriven annotation, its type cannot be overridden by means of the deployment descriptor. The bean’s type (and its session type), if specified must be the same as that specified in annotations.
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post by himaiMinh »

Option 2:
To be able to call doStuff(), the client must be in role "customer"
This case, it is because the deployment descriptor values overrides the annotation values in the bean.

Option 3:
To be able to call doStuff(), the client must be in role "user" or "customer"
This case may work in some EJB container as the deployment descriptor values augments the annotation values in the bean.


Related discussion about another similar question v6.2.603:
viewtopic.php?f=4&t=455&start=10

Post Reply

Who is online

Users browsing this forum: No registered users and 52 guests