-
-
What is Message Driven Bean
Answered by Jey on 2005-05-08 12:30:37: Message Driven Bean (MDB) is an enterprise bean which runs inside the EJB container and it acts as Listener for the JMS asynchronous message . It does not have Home and Remote interface as Session or Entity bean. It is called by container when container receives JMS asynchronous message. MDB has to implement MessageListener which has a method onMessage(Message...
-
What is the life cycle of MDB
Answered by Nikhil on 2005-05-11 01:52:59: The lifetime of an MDB instance is controlled by the container. Only two states exist: Does not exist and Ready , as illustrated in the following figure: The life of an MDB instance starts when the container invokes newInstance() on the MDB class to create a new instance. Next, the container calls setMessageDrivenContext() followed...
-
-
What are the various transaction attributes and differences between them
Answered by Jey on 2005-05-08 18:01:39: There are six transaction attributes that are supported in EJB. 1. NotSupported 2. Supports 3. Required 4. RequiresNew 5. Mandatory 6. Never
-
What is the difference between activation and passivation
Answered by Jey on 2005-05-08 11:55:29: Activation and Passivation is appilicable for only Stateful session bean and Entity bean. When Bean instance is not used for a while by client then EJB Container removes it from memory and puts it in secondary storage (often disk) so that the memory can be reused. This is called Passivation. When Client calls the bean instance again then...
-
-
What is the difference between JNDI context, Initial context, session context and ejb context
Answer posted by Mohan on 2005-05-21 17:07:03: JNDI Context Provides a mechanism to lookup resources on the network Initial Context constructor provides the initial context. Session Context has all the information a session bean would require from the container Entity Context has all the information that an Entity bean would need from a container Ejb Context contains the information...
-
What is CMR
Answer posted by Mohan on 2005-05-21 17:14:47: CMR - Container Managed Relationships allows the developer to declare various types of relationships between the entity beans
-
What is the difference between CMP 1.1 and CMP 2.0
Answer posted by Mohan on 2005-05-21 17:15:36: CMR and sub classing of the CMP bean by the container
-
-
-
-
Why are ejbActivate() and ejb Passivate() included for stateless session bean even though they are never required as it is nonconversational bean
To have a consistent interface, so that there is no different interface that you need to implement for Stateful Session Bean and Stateless Session Bean. Both Stateless and Stateful Session Bean implement javax.ejb.SessionBean and this would not be possible if stateless session bean is to remove ejbActivate and ejbPassivate from the interface. You could argue that the two (stateful and stateless) are...
-
Is stateless Sessiob bean create() method contains any parameters
Answered by Jey Ramasamy on 2005-05-08 20:04:33: No. This method must not contain any input parameters and cannot be overloaded as well.
-
-
-
Is there a way to get the original exception object from inside a nested or wrapped Exception (for example an EJBException or RemoteException)
Absolutely yes, but the way to do that depends on the Exception, since there are no standards for that. Some examples: ·When you have an javax.ejb.EJBException, you can use the getCausedByException() that returns a java.lang.Exception. ·A java.rmi.RemoteException there is a public field called detail of type java.lang.Throwable ·With a java.sql.SQLException you need to use the method getNextException()...
-
-
EJB Interview Questions
Ans