The Difference Between EJB 3.0 and EJB 2.0

1) In EJB3, one can move most of the deployment descriptors of EJB2 in the code itself by using Annotations.
2) One can also avoid writing the common code like Home/Remote interfaces and can use annotations for the same.
3) The container takes care of life cycle methods because in EJB2 we need to declare the life cycle methods like ejbActivate, ejbPassivate, ejbCreate etc. Any method can be made life cycle method by using the proper annotation.
4) Entity Beans in EJB3.0 are POJO and being referred to as JPA entities which makes Entity beans lightweight.
5) The EJB's in EJB 3.0 can extend other EJB's but that is not the case with EJB 2.0
6) EJB 3.0 integrates with ORM tools seamlessly but EJB 2.0 did not provide any support to integrate with ORM tools.
7) EJB 3.0 provides DI for clients invoking the EJB's
8) EJB3.0 provides timer service, interceptors which were not present in EJB 2.0

Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email