Comparison between ejb2.0 and ejb3.0

Questions by Savitha_BM

Showing Answers 1 - 17 of 17 Answers

seshadri

  • Nov 23rd, 2005
 

Hi All,

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 r identifying all entities with '@' symbol.

Thanks and regards,

Seshadri. MCA.

Software Engineer.

  Was this answer useful?  Yes

san31

  • Jan 16th, 2006
 

In EJB3.0 methods like ejbPassivate, ejbActivate, ejbLoad, ejbStore, etc. are no longer required

Amit B. Dutta

Sr. S/w Engineer

  Was this answer useful?  Yes

Rakesh

  • Apr 20th, 2006
 

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).

  Was this answer useful?  Yes

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).

  Was this answer useful?  Yes

javakiran

  • Apr 25th, 2006
 

hi all,First of all, 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

  Was this answer useful?  Yes

Nitin

  • Apr 26th, 2006
 

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.

  Was this answer useful?  Yes

Naga

  • May 24th, 2006
 

EJB 3 is the combination of  Inversion of Control,Dependency Injection, Object/Relational Mapping and integration of tools like Xdoclet.

  Was this answer useful?  Yes

bibekananda satapathy

  • May 26th, 2006
 

Hi 

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.

  Was this answer useful?  Yes

thomaskm

  • Apr 26th, 2007
 

Is the elimination of Home interface, Deployment descriptor, etc in ejb 3.0 has increased the speed of the look up process? Can we prove this with numbers?

Can we use Annotations along with EJB 2.1 version?

  Was this answer useful?  Yes

thomaskm

  • Apr 27th, 2007
 

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 don’t 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 don’t 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 don’t 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 - Don’t 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

  Was this answer useful?  Yes

am577

  • Dec 27th, 2009
 

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.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions