uCosminexus Application Server, EJB Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

2.8.1 Types of cache models of an Entity Bean

An Entity Bean supports the following three types of caching of CMP field and status transition of Entity Bean:

Specify the commit options as attributes (properties) of the Entity Beans included in a J2EE application. For details on the J2EE application settings, see 2.8.2 Defining in cosminexus.xml.

Organization of this subsection
(1) Full caching (commit option A)
(2) Caching (commit option B)
(3) No caching (commit option C)

(1) Full caching (commit option A)

Full caching is the cache model for the Entity Beans of a reference node. When a transaction starts, the data is not read from the database to the Entity Bean instance. As a result, the transaction starts with the Entity Beans in the same state as that during the previous transaction commit.

For example, if the Entity Beans are updated by another J2EE server from the time of the previous transaction commit until the beginning of the transaction, the consistency of the Entity Bean status cannot be maintained.

(2) Caching (commit option B)

Caching is the cache model of the Entity Beans of an update node. When a transaction starts, the data is read from the database to the Entity Bean instance. As a result, the transaction is started with the Entity Beans in the same state as the latest state of the database.

(3) No caching (commit option C)

No caching is the cache model of the Entity Beans of an update node. During transaction commit, the Entity Beans are passivated. When the transaction starts, the Entity Beans are activated once and the data is read from the database to the Entity Bean instance. As a result, the transaction is started with the Entity Beans in the same state as the latest state of the database. This cache model is, therefore, applied while using a large number of Entity Beans in a business application.