Questions
ejbCreate() method of CMP bean returns.
- null
- Primary Key class
- Home Object
- Remote Object
The EJB specification architecture does NOT define
- transactional components.
- client side security and encryption.
- distributed object components.
- server-side components.
What executes EJB components?
- a web server
- an EJB container
- an application server
- a database server
Which describes best an EJB handle?
- An EJB handle is used to handle exceptions when accessing EJB objects.
- An EJB handle is used to store a reference to a specific EJB object.
- An EJB handle is part of the Home interface.
- An EJB handle is used for local references inside the EJB container.
When a developer declares an EJB local reference, what element does NOT need to be specified?
- JNDI binding for local home interface
- Local home interface
- Home interface
- ejb-ref-type
For a stateful session bean, which method is activated by the container to save the state of the bean?
- ejbCreate()
- ejbPassivate()
- ejbStore()
- ejbSave()
The EJB SessionContext can be used to get information about users calling session enterprise beans. Which information can NOT be retrieved?
- transactional information
- security information
- data source information
- timer service information
Client programs that access EJBs make use of the Java Naming and Directory Interface (JNDI). To get access to a Person entity bean, which methods can be used? (2 correct answers). Assume the following code is used to establish the initial context:
Propert
- PersonHome ph = ctx.lookup("java:comp/env/ejb/Person");
- PersonLocalHome ph=(PersonLocalHome)ctx.lookup("java:comp/env/ejb/PersonLocalHome");
- PersonHome ph = ctx.lookup("java:comp/env/ejb/PersonHome");
- PersonHome ph = javax.rmi.PortableRemoteObject.narrow(ctx, PersonHome.class)
- PersonHome ph = (PersonHome)javax.rmi.PortableRemoteObject.narrow(ctx,PersonHome.class)
What would be a typical use of ejbSelect() methods?
- Using ejbSelect() methods in session beans for specifying the selection criteria for a list
- Using ejbSelect() methods within ejbHome methods to return entities
- Using ejbSelect() methods to access fields of a bean instance
- Using ejbSelect() methods to perform operations not specific to a entity instance
CMP fields in EJB 2.x are defined via
- static fields in the entity bean
- an abstract persistence schema
- EJB Query Language definitions in the deployment descriptor
- the persistence-type attribute in the deployment descriptor
In order to use Container Managed Relations (CMR) fields in CMP entity beans, the developer Must
- declare the CMR member fields and add ejb-relationship definitions in the deployment descriptor
- implement the get/set methods for the CMR fields and add ejb-relationship definitions in the deployment descriptor
- implement the ejbLoad() and ejbStore() methods and add ejb-relationship definitions in the deployment descriptor
- declare abstract get/set methods for the CMR field and add ejb-relationship definitions in the deployment descriptor