Looking at the past threads in TheServerSide.com and talking to several of our customers, it is very apparent that there are a lot of confusions surrounding EJB 3.0. So I decided to put together an unofficial FAQ on this topic. Please note that this is based on the EJB 3.0 draft specification, presentation delivered by Linda DeMichiel in TSS Symposium and JavaOne and comments on several forums by EJB 3.0 expert group. This FAQ is neither approved by Sun nor the JCP.
Which JSR covers EJB 3.0 specification and who is the specification lead of EJB 3.0 expert group?
EJB 3.0 specification is covered under JSR-220 under the leadership of Linda DeMichiel of Sun Microsystems. For details about JSR-220 and memberships please visit http://jcp.org/en/jsr/detail?id=220
Is there an early draft available for EJB 3.0?
Yes. The early draft of EJB 3.0 can be accessed from http://jcp.org/aboutJava/communityprocess/edr/jsr220/index.html
What are the main goals of EJB 3.0?
The main goals of EJB 3.0 are:
1. Simplify EJB development
Define metadata annotations that be used with EJB. Annotations will be used by developers for reducing the program artifacts required for deployment and eliminating need of deployment descriptors.
EJBs will closely resemble plain Java objects (“POJOs”) or JavaBeans.
The requirement for EJB component interfaces for session beans and entity Bean is being removed. The required business interface for a session bean is an ordinary Java interface not an EJBObject, EJBLocalObject, or java.rmi.Remote interface. No interfaces are required for entity beans.
Elimination of the requirement for Home interfaces.
Encapsulation of environmental dependencies and JNDI access through the use of annotations, dependency injection mechanisms, and simple lookup mechanisms.
2. Simplify Container Managed Persistence
CMP Entity Beans will resemble POJO based persistence
Support for lightweight domain modeling, including inheritance and polymorphism.
Specification of Java language metadata annotations for the object/relational mapping of
Entity beans with container-managed persistence.
Enhancements to EJB QL to provide greater usability. Addition of projection, explicit inner and outer join operations, bulk update and delete, sub queries, and group-by. Addition of adynamic query capability and support for native SQL queries.
3. Reduction of the requirements for usage of checked exceptions.
4. Elimination of the requirement for the implementation of callback interfaces.
5. Improved ability for testing outside the container.
Is Hibernate EJB 3.0? Is Hibernate the API for EJB 3.0? Is Hibernate the reference implementation for EJB 3.0?
Hibernate is neither EJB 3.0 nor the reference implementation for EJB 3.0. The persistence aspect of EJB 3.0 is not based solely on Hibernate and derived from leading O-R frameworks like Hibernate, OracleAS TopLink, etc.
What is the consolidation effort for merging EJB 3.0 and JDO 2.0 persistence into one?
Linda DeMichiel Specification lead of EJB 3.0 Expert Group (JSR-220) and Craig Russell specification lead of JDO 2.0 Expert Group (JSR-243) have released an open letter to the Java Community describing Sun’s decision to combine the effort of JSR-220 and JSR-243 to create a single POJO persistence model for Java.
The short summary is
Will JSR-220 produce two specifications?
Yes, JSR-220 will produce two specifications, one for EJB and one for the unified persistence model. Also RI, TCK will be different for core EJB 3.0 specification and the POJO persistence model.
Can I use the new persistence model delivered by JSR-220 outside EJB container?
Yes. The new POJO persistence model can be used outside EJB 3.0 container and also be used in J2SE.
Why the persistence work is still being done under JSR-220 instead of creating another JSR?
Creation of a new JSR takes long time and the JCP (and Sun) does not want to delay the release of a simplified persistence model work started by EJB 3.0 expert committee that has been very well received by the Java community. Also Sun does not want to throw away the great work that has been done by the EJB 3.0 expert group.
Does the EJB 3.0 expert group have any members with Object-Relational expertise?
There are active participations from all leading application server vendors and as I understand contribution is coming from many different sources that bring vast experiences and customer inputs. This includes but not limited to Oracle, BEA, IBM, Sun and JBoss/Hibernate.
There are several members of the EJB 3.0 expert group whose primary area of expertise is object-relational persistence. For example, Gavin King is the founder of Hibernate and the Oracle representative Mike Keith is an Architect of the TopLink development team.
This will be complemented by when several members from JDO 2.0 expert group will join the JSR 220 expert group.
What is target release for EJB 3.0 and the new persistence specification?
The original target release of EJB 3.0 (and J2EE 5.0) was summer of 2005. Certainly this date will be impacted by the unification of persistence specification.
What will happen to old-style (EJB 2.1 and EJB 2.0) CMP Entity Beans?
EJB 3.0 compliant containers for backward compatibility will still support the old style CMP Entity beans. Also EJB 3.0 plans to extend the EJB-QL for the EJB 2.1 style CMP entity beans.
Where is the official EJB 3.0, JDO 3.0 FAQ?
The official FAQ from Sun will be posted at http://java.sun.com/j2ee/. So stay tuned!