EJB BMP Locking and Caching Strategies for Server 6.0


This section summarises the various locking and caching modes that can be configured for the Bean Managed Persistence (BMP) Entity Beans. BMP Entity beans can be configured to perform pessimistic or optimistic locking.

Topics Covered


Default behavior of Bean Managed Persistence

Following is the default BMP behavior: Note: This behavior must be used when all updates to the entity are through the container.

Bean Managed Persistence - Cache and Load at Transaction Begin behavior

Note: This behavior can be used when there are external updates to the entities in the database.

Bean Managed Persistence - No Lock behavior

No Lock behavior does not lock entities at the container level.

Configuring Bean Managed Persistence Modes

Following is the procedure for configuring BMP modes: Note: To provide backward compatibility, lock-bmp tag is still supported in Pramati Server 6.0.

One to one correspondence between lock-bmp and bmp-locking-option values:

BMP behavior lock-bmp value bmp-locking-option value
Default behavior true lock-with-cache-enabled
Cache and Load at Transaction Begin behavior pre50 lock-and-load-in-transaction
No Lock behavior false no-lock

A summary of Bean Managed Persistence behavior

The following table summarises the BMP behavior:

Behavior Transaction Default BMP Cache and Load at Transaction Begin BMP No Lock BMP
Lock Tx Yes Yes No
Lock Non-Tx Yes Yes No
Load Tx If not cached Yes Yes
Load Non-Tx If not cached If not cached If not cached
Store Tx Yes Yes Yes
Store Non-Tx No No No
Master Copy - No No Yes
Multiple instances - No No Yes

© Pramati Technologies 2007