|
1. Brief description about local interfaces? Answer: EEJB was originally designed around remote invocation using the Java Remote Method Invocation (RMI) mechanism, and later extended to support to standard CORBA transport for these calls using RMI/IIOP.This design allowed for maximum flexibility in developing applications without consideration for the deployment scenario, and was a strong feature in support of a goal of component reuse in J2EE.Many developers are using EJBs locally -- that is, some or all of their EJB calls are between beans in a single container.With this feedback in mind, the EJB 2.0 expert group has created a local interface mechanism.The local interface may be defined for a bean during development, to allow streamlined calls to the bean if a caller is in the same container.This does not involve the overhead involved with RMI like marshalling etc.This facility will thus improve the performance of applications in which co-location is planned.Local interfaces also provide the foundation for container-managed relationships among entity beans with container-managed persistence. 2. What are the callback methods in Entity beans? Answer: Callback methods allows the container to notify the bean of events inits life cycle.The callback methods are defined in the javax.ejb.EntityBean interface. 3. What is bean managed transaction? Answer: If a developer doesn't want a Container to manage transactions, it's possible to implement all database operations manually. 4. What is the relationship between local interfaces and container-managed relationships? Answer: Entity beans that have container-managed relationships with other entity beans, must be accessed in the same local scope as those related beans, and therefore typically provide a local client view.In order to be the target of a container-managed relationship, an entity bean with container-managed persistence must provide a local interface. 5. What is the new basic requirement for a CMP entity bean class in 2.0 from that of ejb 1.1? Answer: It must be abstract class.The container extends it and implements methods which are required for managing the relationships 6. How JDBC services can be used in clustered environment? Answer: Identical DataSource has to be created in each clustered server instances and configure to use different connection pools. 7. What is the difference between session and entity beans? When should I use one or the other? Answer: An entity bean represents persistent global data from the database; a session bean represents transient user-specific data that will die when the user disconnects (ends his session).Generally, the session beans implement business methods (e.g.Bank.transferFunds) that call entity beans (e.g.Account.deposit, Account.withdraw) 8. What is Entity Bean? Answer: The entity bean is used to represent data in the database. 9. What is the difference between a Server, a Container, and a Connector? Answer: An EJB server is an application, usually a product such as BEA WebLogic, that provides (or should provide) for concurrent client connections and manages system resources such as threads, processes, memory, database connections, network connections, etc.An EJB container runs inside (or within) an EJB server, and provides deployed EJB beans with transaction and security management, etc.The EJB container insulates an EJB bean from the specifics of an underlying EJB server by providing a simple, standard API between the EJB bean and its container.A Connector provides the ability for any Enterprise Information System (EIS) to plug into any EJB server which supports the Connector architecture. 10. For Entity Beans, What happens to an instance field not mapped to any persistent storage, when the bean is passivated? Answer: The specification infers that the container never serializes an instance of an Entity bean (unlike stateful session beans).Thus passivation simply involves moving the bean from the "ready" to the "pooled" bin.So what happens to the contents of an instance variable is controlled by the programmer.Remember that when an entity bean is passivated the instance gets logically disassociated from it's remote object.Be careful here, as the functionality of passivation/activation for Stateless Session, Stateful Session and Entity beans is completely different.For entity beans the ejbPassivate method notifies the entity bean that it is being disassociated with a particular entity prior to reuse or for dereference.
|