JavaPolis 2005 – EJB 3.0


While EJB 3.0 persistence gains a lot of attention we should not forget that EJB is more than persistence but also contains session beans and messaging driven beans. Mike Keith and Linda DeMichiel gave an excellent overview of the changes and improvements we can expect on these EJB’s. They explained that the driving force of EJB 3.0 is ‘ease-of-development’. While the current EJB’s are very powerfull they are also quite complex. Based upon Java metadata (annotations), dependency injection and on default, standard, usage we’ll get rid of the EBJ interfaces, the deployment descriptor and of the SessionContext in the code. This makes EJB’s much more like real POJO’s which results in cleaner, more comprehensible and better testable code.


For example:

import javax.ejb.Stateless.*;
* A simple stateless session bean implementing the incrementValue() method of the
* CalculateEJB interface.
public class CalculateEJBBean implements CalculateEJB {
int value = 0;
public String incrementValue() {
return "value incremented by 1";

Other improvements are the Enhanced Lifecycle Methods and Call Back Listeners: Instead of implementing the unnecessary callback methods like ejbActivate, ejbPassivate etc. any method can be designated to receive notifications for life cycle events. Another addition are Interceptors that are designed to intercepts a business method invocation.
EJB 3.0 will be backwards compatible and will support incremental migration.

Although the production release will be ready only until JavaOne, many vendors are already offering EJB 3.0 implementations.

More info:

About Author

Aino Andriessen is principal consultant and expertise lead 'Continuous Delivery'. His focus is on Oracle Fusion Middleware ADF and SOA development, Continuous Delivery, architecture, improving the software development proces and quality management. He is a frequent presenter at Oracle Open World, ODTUG Kaleidoscope, UKOUG Technology Conference and OUGN Vårseminar. He writes articles and publishes at the AMIS technology blog (

Comments are closed.