Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g (10.1.3.1.0) Part Number B28221-02 |
|
|
View PDF |
This section describes the following:
Stateless session beans are useful mainly in middle-tier application servers that provide a pool of beans to process frequent and brief requests.
In practical terms, Table 1-20 provides a definition for both BMP and CMP, and a summary of the programmatic and declarative differences between them.
Table 1-20 Comparison of Bean-Managed and Container-Managed Persistence
Management Issues | Bean-Managed Persistence | Container-Managed Persistence |
---|---|---|
Persistence management |
You are required to implement the persistence management within the For example, the |
The management of the persistent data is done for you. That is, the container invokes a persistence manager on behalf of your bean. You use |
Finder methods allowed |
The |
The |
Defining container-managed persistent fields |
N/A |
Required within the EJB deployment descriptor. The primary key must also be declared as a container-managed persistent field. |
Mapping container-managed persistent fields to resource destination |
N/A |
Required. Dependent on persistence manager. |
Definition of persistence manager |
N/A |
Required within the Oracle-specific deployment descriptor. By default,OC4J uses the TopLink persistence manager. |
With CMP, you can build components to the EJB 2.0 specification that can save the state of your EJB to any Java EE supporting application server and database without having to create your own low-level JDBC-based persistence system.
With BMP, you can tailor the persistence layer of your application at the expense of additional coding and support effort.
For more information, see the following: