What is the difference b/w EJB2.1 and EJB3.0?

Questions by enjoy

Showing Answers 1 - 15 of 15 Answers

santh kumar

  • Feb 19th, 2007
 

 
  EJB3.0                                                               

  1. No need of Home Interface (EJBHome),but it is needed in EJB2.0
  2. No more confusions to make an EJB remote or local,it's the client which would decide and cast to appropriate.
  3. Just write SINGLE simple Java class and annotate it to be Stateless/Stateful/Entity/MessageDriven.Container
  4. No Deployment Descriptors , MetaData Annotations are explored which is introduced in J2SE5.0
  5. Forget all EJB life cycles.For example Entity bean life cycle in 3.0 is new,managed,detached,removed.

    Ready to develop complex query,inner/outer join with EJB3.0.

The inportant change is introduction of JPA. Now you don't have to use Entity bean as remote object. It will be just POJO for you. you can use them as a object. For persistency layer different ORM can be used like hibernate, toplink are the most perferred ones. You can use them outside the container also. Using of annotation made life simple for developers.

The main difference lies in the persistence, In case of EJB 3.0 there is JPA, Java persistence API which makes the mapping of EntityBeans with the database easy, with the help of a service called as EntityManager.
Mapping is done with the help of annotations unlike in EJB2.0.
Home interfaces are eliminated.
Deployment descriptors are an option in EJB 3.0.
EJB3.0 also supports webservice client through SOAP and WSDl.

  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