Specifies when the bean loads its state from the database. The
value of this property implies whether the container has exclusive or shared
access to the database. Valid values are Activation and
Transaction. Activation indicates that the bean is loaded when it is
activated (Once or Transaction) and implies that the container has exclusive
access to the database. Transaction indicates that the bean is loaded
at the start of a transaction and implies that the container has shared access
to the database. The default is Transaction.
The settings of the Activate at and Load at properties govern which commit
options are used. The commit options are described in detail in the
Enterprise JavaBeans specification, version 1.1.
- For Commit Option A (implies exclusive DB access), use Activate at = Once
and Load at = Activation. This option reduces database I/O (avoids
calls to the ejbLoad function) but serializes all transactions accessing the
bean instance. Option A can increase memory usage by maintaining more
objects in the cache, but could provide better response time if bean instances
are not generally accessed concurrently by multiple transactions.
- For Commit Option B (implies shared DB access), use Activate at = Once,
Load at = Transaction. Option B can increase memory usage by
maintaining more objects in the cache. However, because each
transaction creates its own copy of an object, there can be multiple copies of
an instance in memory at any given time (one per transaction), requiring that
the database be accessed at each transaction. If an enterprise bean
contains a significant number of calls to the ejbActivate function, using
Option B can be beneficial because the required object is already in the
cache. Otherwise, this option does not provide significant benefit over
Option A.
- For Commit Option C (implies shared DB access), use Activate at =
Transaction and Load at = Transaction. This option can reduce memory
usage by maintaining fewer objects in the cache, however, there can be
multiple copies of an instance in memory at any given time (one per
transaction). This option can reduce transaction contention for
enterprise bean instances that are accessed concurrently but not
updated.