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
 

Configuring a Read-Only BMP Entity Bean

You can configure a BMP entity bean as read-only. By doing so, you enter into a contract with OC4J by which you guarantee not to change the BMP entity bean's state after it is activated. Unlike CMP read-only, no exception will be thrown if you do update a read-only BMP bean.

When you configure a BMP entity bean as read-only, OC4J uses a special case of commit option A (see "Configuring BMP Commit Options") to improve performance by:

As Figure 15-1 shows, multiple clients accessing the same read-only BMP entity bean by primary key are allocated a single instance. Both Client 1 and Client 2 are satisfied by the same cached read-only BMP entity bean instance. Because the BMP entity bean is read-only, both transactions can proceed in parallel.

Without this optimization, each client is allocated a separate instance and each instance requires the execution of all lifecycle methods.

Figure 15-1 Read-Only BMP Entity Beans and Commit Option A

Description of Figure 15-1  follows
Description of "Figure 15-1 Read-Only BMP Entity Beans and Commit Option A"

Using Deployment XML

Example 15-1 shows the orion-ejb-jar.xml file entity-deployment element locking-mode attribute mode configured to specify a BMP entity bean as read-only.

Example 15-1 orion-ejb-jar.xml For Read-Only

<entity-deployment
    name=EmployeeBean"
    location="bmpapp/EmployeeBean" 
    locking-mode="read-only"
>
...
</entity-deployment>