Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3)
B14428-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

EJB 2.1 Support

In this release, OC4J supports the functionality specified in the EJB 2.1 final release specification (http://java.sun.com/products/ejb/docs.html).

This section describes:

What JDK is Required?

If you are using EJB 2.1, then you must use JDK 1.4 or higher.

How do You Define an EJB 2.1 Application?

OC4J assumes that the application is an EJB 2.1 application if element cmp-version is set to 2.x.

How does OC4J Manage Persistence in an EJB 2.1 Application?

OC4J delegates persistence operations to a persistence manager. In this release, OC4J uses the TopLink persistence manager by default (see "TopLink Persistence Manager").

The Orion persistence manager is deprecated. Oracle recommends that you use OC4J and the TopLink persistence manager for new development. Using the migration tool (see "Migrating to the TopLink Persistence Manager"), you can easily migrate an existing OC4J application that uses EJB 2.0 entity beans with the Orion persistence manager to use EJB 2.0 entity beans with the TopLink persistence manager. For more information about the Orion persistence manager, see the Oracle Containers for J2EE Orion CMP Developer's Guide.

TopLink Persistence Manager

Oracle TopLink is an advanced, object-persistence and object-transformation framework that provides development tools and run-time capabilities that reduce development and maintenance efforts, and increase enterprise application functionality.

In this release, OC4J uses TopLink as the persistence manager for EJB 2.1 CMP entity beans.

For more information about the TopLink persistence manager, see "What is TopLink?" in the Oracle TopLink Developer's Guide.

For EJB 2.1 projects, you use the TopLink Workbench (see "Understanding the TopLink Workbench" in the Oracle TopLink Developer's Guide) to configure persistence properties in the toplink-ejb-jar.xml file (see "What is the toplink-ejb-jar.xml File?"). When you migrate an Orion CMP application to TopLink persistence (see "Migrating to the TopLink Persistence Manager"), the TopLink migration tool automatically creates a TopLink Workbench project for you.

You can customize this configuration at runtime using a TopLink customization class (see "Customizing the TopLink Persistence Manager").

Customizing the TopLink Persistence Manager

At runtime, you can access TopLink persistence manager API to take advantage of advanced TopLink features.

To access the TopLink persistence manager API in an EJB 2.1 CMP application, you can include a TopLink customization class in your deployment JAR.

This optional Java class implements oracle.toplink.ejb.cmp.DeploymentCustomization to allow deployment customization of TopLink mapping and run-time configuration. At deployment time, the TopLink run time creates a new instance of this class and invokes its methods beforeLoginCustomization (before the TopLink run time logs into the session) and afterLoginCustomization (after the TopLink runtime logs into the session), passing in the TopLink session as a parameter.

Use your implementation of the beforeLoginCustomization method to configure TopLink session attributes including: cache coordination, parameterized SQL, native SQL, batch writing/batch size, byte-array/string binding, login, event listeners, table qualifier, and sequencing.

For EJB 2.1, you can use a TopLink customization class to access TopLink persistence manager API not accessible from the TopLink Workbench GUI.

For more information, see:

Migrating to the TopLink Persistence Manager

Using the TopLink migration tool, you can easily migrate an existing OC4J application that uses EJB 2.0 entity beans with the Orion persistence manager to use EJB 2.0 entity beans with the TopLink persistence manager.

For more information on using the TopLink migration tool, see "Migrating OC4J Orion Persistence to OC4J TopLink Persistence" in the Oracle TopLink Developer's Guide.