This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
* Can't invoke EJBObject.getPrimaryKey() in ejbCreate() of CMP.
* getRollbackOnly(), getUserTransaction() can be called from inside onMessage()
* An enterprise bean must not use the java.util.zip package for reading and writing the standard ZIP to ensure portiability
* The following are considered to be goals of the EJB 2.0 Specification: - Define the integration of EJB with the Java Message Service. - Provide a local client view and support for efficient, lightweight access to enterprise beans from local clients. - Provide improved support for the persistence of entity beans. - Provide improved support for the management of relationships among entity beans. - Provide a query syntax for entity bean finder methods. - Provide support for additional methods in the home interface. - Provide for network interoperability among EJB servers.
* The ejb-jar file must contain, either by inclusion or by reference, the class files for all the classes and interfaces that each enterprise bean class and the home and component interfaces depend on, except J2EE and J2SE classes.
* java:comp/env is the JNDI name of an enterprise bean's environment
* <ejb-ref> element in DD allows the bean provider to locate the home interface of other enterprise beans without knowing where the object resides in the enterprise system.
* <ejb-ref>: Ensuring that the target enterprise method is type-compatible with the declared EJB reference are the responsibilities of both the application assembler and the deployer.
* If the value of the <res-auth> element was Application the bean provider would be responsible for performing a sign-on to the resource manager programmatically.
* Linking an EJB reference to a target enterprise bean - Application Assembler
* Binding the homes of enterprise beans that exist in the target operational environment - Deployer
* Environment entry value - Bean Provider, App Assembler, Deployer
* Adding, removing and configuring resource managers - System adminstrator
* SessionSynchronization - Provides notification of the events of the transactional context it is involved in
* The Bean Provider must ensure that the Java types assigned to the cmp-fields are restricted to the Java primitive types and Java serializable types.
* The <primkey-field> is an optional element and is used to map a single field to a primary key.
===== * Application Assembler can use the <exclude-list> element to indicate the set of methods that should not be called
* Assign method permissions for all of the unspecified methods - Deployer
* The Application Assembler is allowed to modify the values of the environment entries set by the Bean Provider.
* The Deployer can modify the values of the environment entries that have been previously set by the Bean Provider and/or Application Assembler, and must set the values of those environment entries for which no value has been specified.
* The Application Assembler can use the <ejb-link> element in the deployment descriptor to link an EJB reference to a target enterprise bean. Can also bo linked to (in the same J2EE application unit) different ejb-jar file. e.g. <ejb-link>../products/product.jar#ProductEJB</ejb-link>
* The Deployer must ensure that the target enterprise bean is type-compatible with the types declared for the EJB reference.
* Deployer should bind the enterprise bean reference to the home of the enterprise bean specified as the link�s target.
* Session beans and Message-driven beans are never re-entrant.
* <session-type>, <transaction-type>, <persitence-type>, <message-selector>, <acknowledge-mode> are elements inside <enterprise-beans>
* Application assembler must never modify <abstract-schema-name>, <relationship-role-source>
* EJB QL <query> <query-method> <method-name>ejbSelectPendingLineitems</method-name> <method-params/> </query-method> <ejb-ql>SELECT OBJECT(l) FROM LineItems l WHERE l.shipped <> TRUE </ejb-ql> </query>
* An enterprise bean must not attempt to listen on a socket. Creating a socket is ok.
* The enterprise bean must not attempt to use the Reflection API to access information that the security rules of the Java programming language make unavailable.
* The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams.
* The enterprise bean must NOT attempt to define a class in a package.
* JTA 1.0.1, the UserTransaction interface ONLY
* JavaMail 1.1, sending mail ONLY
* Bean provider must define EJBQL for all finders, selectors including ejbFindByPrimaryKey(key)
* If a business method raises a system exception whilst in the context of transaction, afterCompletion() is called on the session bean instance with a boolean value of false to notify the instance that a rollback has occurred.
* Invoking javax.ejb.EJBObject.getPrimaryKey() on a session bean results in javax.rmi.RemoteException been thrown.
* BasketHome basketHome = (BasketHome)initialContext.lookup("java:comp/env/ejb/basket"); // implies Basket is local as no PortableRemoteObject.narrow()
* basketHome.create(discountVoucher); //Basket is a Stateful bean as create() with args
* EJBMetaData interface for the session bean is obtained using a remote home interface
* Along with the System Administrator setting up of the principal delegation in a Container-specific way - Deployer
* Deployer sets up the appropriate security policy for the enterprise bean application. Application Assembler and Deployer define the appropriate security policies for the application.
* When ejbActivate() is invoked in an entity bean there is no client, this means that the Container cannot invoke getCallerPrincipal() or isCallerInRole(). java.lang.IllegalStateException will be thrown.
* SELECT DISTINCT OBJECT (p) FROM Pet p, Owner o WHERE p.petname = o.petname // is a valid query
* For session bean ejbCreate() is invoked by the container with an unspecified transaction context
* ejbPassivate() is invoked by the container before passivating the bean instance giving the bean provider an opportunity to ensure that the bean's state meets the requirements for passivation and to allow the bean provider to release any open resources.
* Bean class may implement the session bean's component interface.
* The conversational state of a stateful session bean may hold resources such as open socket connections and open database cursors. However, the container cannot retain the open resources when the bean instance is passivated.
>Bean provider must define EJBQL for all finders, selectors including >ejbFindByPrimaryKey(key) >
I need a quick correction if I'm not correct.........??? ejbFindByPrimaryKey doesnt need to have EJBQL......!!! I mean ...all finders exceptin ejbFindByPrimaryKey need ejbql. Please tell me the correct option....it will make me feel better Amol.