You are on page 1of 3

1) EJB2.0 has Deployment descriptors but in EJB3.0 has no Deployment Descriptors. 2) EJB2.

0 we have to write Home and Remote Interfaces But in EJB3.0 No need to write Home and remote interfaces. 3) In EJB3.0 we are identifying all entities with '@' symbol.
EJB3.0 methods like ejbPassivate, ejbActivate, ejbLoad, ejbStore, etc. are no longer required Lot of changes has been done in EJB3, It is more than just removal or addition of some methodes/interface. When U will see EJB3 entity bean specification, it is totally new design and new concept of entity manager. EJB3.0 entity bean is just a POJO with newly introduced annotation and entity manager(No JNDI or deployment description files). It is simplified and can be loaded in independent JVM(No EJB container required to run) as well(similar to JDO). The major diffrence that the EJB 3.0 spec, brings is in the data layer.i.e. now EJB supports Java Persistence API for all its data needs.Secondly, we don't need to fight with the XMLDeployment Descriptors, instead now EJB 3.0 supports Meta data Annotations which is very descriptiveThirdly comes the POJO one.we can ask why EJB has not taken the route of Spring/JBOSS/Hibernate in the persistence model , but the entire specification is now not related to any one framework moreover Persisitence API is more generalized.I think these points are the major differences between 2.0 and 3.0, pls correct me if notcheerssaikiran ejb3.0 is based on Object Relational Mapping (ORM) and is in form of POJO with Metadata annotations . we have annotation to define any relationship (one to one , one to many etc) which a database can have so our entity pojo's directly get mapped to database table along with relations. EJB 3 is the combination of Inversion of Control,Dependency Injection, Object/Relational Mapping and integration of tools like Xdoclet.

The main differences are a)EJB2.0 we have to write Home and Remote Interfaces But in EJB3.0 No need to write Home and remote interfaces. b)EJB2.0 has Deployment descriptors but in EJB3.0 has no Deployment Descriptors. c)In EJB3.0 methods like ejbPassivate, ejbActivate, ejbLoad, ejbStore, etc. are no longer required d)the major diffrence that the EJB 3.0 spec,is its the data layer.i.e. now EJB supports Java Persistence API for all its data needs.
The major differences i have seen between EJB 2.x and EJB 3.0 versions are as follows :1). Removal of home interface enabled simple lookup process in ejb 3.0 2). EJB deployment descriptors are not required in ejb3.0

3). Annotations are used in ejb3.0 4). EJB 3.0 entity beans dont have home and remote interfaces. 5). EJB 3.0 entity beans/JPA becomes local. Remote annotations are not at all supported for entity beans. 6). EJB 3.0 beans dont implement the standard interfaces like javax.ejb.SessionBean and hence no need to implement the container call back methods like ejbActivate(), etc 7). Query is very flexible. Multiple levels of joins are enabled through the refined EJB-QL 8). Can be used with pluggable, third party persistence providers 9). Security can be provided either through annotations or through deployment descriptors 10). POJO like EJB 3.0 entities become lightweight and easy to convert from a DAO to Entity bean or vice versa. Since EJB 3 entities dont need implement any interface.

I need more info on the following factors :1). Performance efficiency achieved by the removal of home interface, deployment descriptor, etc 2). container call back methods like ejbCreate() etc are eliminated. Then what about the customised implementation possibility of session bean in ejb3.0? 3). Is all the transaction attributes in ejb 3.0 are supported in ejb2.1? 4). REQUIRED - Start a new transaction if necessary SUPPORTS - Dont start a new transaction, but use one if exists REQUIRESNEW Always start a new transaction, suspending the old one MANDATORY - Require the caller to have started a transaction NEVER - Forbid the caller to have started a transaction NOTSUPPORTED Suspend any active transaction

The deployment descriptors are no longer required; everything can be accomplished using metadata annotations.

The CMP (Container Managed Persistence) has been simplified; it is now more like Hibernate or JDO. Programmatic defaults have been incorporated. For example, the transaction model is set to REQUIRED by default. The value needs to be set only if a specific value other than the default value is desired. The use of checked exceptions is reduced; the RemoteException is no longer mandatory on each remote business method. Inheritance is now allowed; therefore, beans can extend some of the base code. The native SQL queries are supported as an EJB-QL (Query Language) enhancement.

You might also like