EJB applications

IBM WebSphere® Application Server provides broad support for enterprise beans, including the Enterprise JavaBeans (EJB) 2.x and EJB 3 specifications. The EJB 2.x specification includes a container-managed persistence (CMP) 2.0 component model, which provides a number of improvements to aid developer productivity and application performance. The EJB 3 specification simplifies the development of business logic and data handling for enterprise applications.

Your EJB application development can include asynchronous messaging, which the product supports as a method of communication based on the Java Message Service (JMS) programming interface. Your application can exchange messages asynchronously with other JMS clients by using JMS destinations (queues or topics). Your application can explicitly poll for messages on a destination, or it can use the message listener service to automatically retrieve messages from JMS destinations without having to explicitly poll JMS destinations.

Version support

The EJB 3.0 specification simplifies the development of business logic and data handling for enterprise applications. The EJB 2.x specification features a container-managed persistence (CMP) 2.0 component model, which provides a number of improvements to aid developer productivity and application performance.

In addition, this product continues to fully support enterprise beans written to the CMP 1.1 programming model and deployed in previous versions of this product; applications can use CMP 1.1 beans, CMP 2.0 beans, or a mixture of both. CMP 1.1 beans can be directly carried forward in an EJB 1.1 ejb-jar module or may be repackaged and combined with CMP 2.0 beans in an EJB 2.x module.

Several excellent trade books that cover the latest EJB specification and the CMP persistence model are available. A good way to locate some of these is to visit your favorite online bookstore and search on the term Enterprise JavaBeans.

Innovations for EJB 3.0 development

The purpose of the EJB 3.0 release is to make things simpler for the developer of enterprise applications. In particular, the new persistence model, called the Java Persistence API (JPA), is much simpler than the Container Managed Persistence (CMP) Entity bean approach from earlier releases. With a focus on the premise that a simple JavaBean can be used in most cases, and greater complexity should only be used when called for, EJB 3.0 simplifies the application development process in the following ways.

  • Annotations to provide component metadata. It is no longer necessary to create Extensible Markup Language (XML) deployment descriptors.
  • Programmatic defaults so you do not need to specify most commonly used requirements in the EJB container. You only need to specify an item if you do not want the default value.
  • A dependency injection function and simpler lookup APIs for easier access to a bean's environment.
  • Plain Old Java Object (POJO) development for both business logic and persistence. This enables unit test outside of the application server, reducing the edit-compile-deploy-debug cycles currently used with applications. It also removes dependencies on external framework interfaces such as javax.ejb.SessionBean, javax.ejb.EJBObject, and so on.
  • No requirement for session beans to have home interfaces.
  • Simplified entity persistence through the JPA. Lightweight domain modeling, including inheritance and polymorphism, is supported.

Innovations for EJB 2.x development

For EJB 2.x modules, a feature introduced in Version 5 of this product, called access intent policies, eases the management of interactions between CMP beans and their underlying data stores. Each policy sets data access characteristics such as access type (read or update) and transaction isolation that affect the locking of resources, letting you choose the level of data integrity and performance for your application. The Integration Server product adds APIs to enable you to further customize IBM-provided access intent policies for your particular environment.

Access intent is frequently used with the function of application profiling.For example, you can configure one transaction to load an entity bean with strong update locks and configure another transaction to load the same entity bean without locks.

Sometimes when working with entity beans you might find that it is better to use the dynamic query service rather than the regular EJB query service (which can be referred to as deployment query).




Related tasks
Changing applications to WebSphere "version specific" setRollbackOnly behavior
Related information
Data access resources
Introduction: Messaging resources
Configuring the message listener service
Access intent policies for EJB 2.x entity beans
Concept topic Concept topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Jun 11, 2013 8:40:09 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v701sca&product=was-nd-mp&topic=welcejbmodules
File name: welcejbmodules.html