Access intent policies

An access intent policy is a named set of properties (access intents) that governs data access for Enterprise JavaBeans (EJB) persistence. You can assign policies to an entity bean and to individual methods on an entity bean's home, remote, or local interfaces during assembly. Access intents are settable only within EJB Version 2.x-compliant modules for entity beans with CMP Version 2.x.

WAS supplies a number of access intent policies that specify permutations of read intent and concurrency control; the pessimistic/update policy can be qualified further. The selected policy determines the appropriate isolation level and locking strategy used by the run-time environment.

Access intent policies are specifically designed to supplant the use of isolation level and access intent method-level modifiers found in the extended deployment descriptor for EJB version 1.1 enterprise beans. You cannot specify isolation level and read-only modifiers for EJB version 2.0 enterprise beans.

Access intent policies are named and defined at the module level. A module can have one or many such policies. Policies are assigned, and apply, to individual methods of the declared interfaces of entity beans and their associated home interfaces. A policy is acted upon by the combination of the EJB container and persistence manager when the method causes the entity to load.

For entity beans that are backed by tables with nullable columns, use an optimistic policy with caution. Nullable columns are automatically excluded from overqualified updates at deployment time; concurrent changes to a nullable field might result in lost updates. When used with the IBM WebSphere Studio Application Developer, WAS provides support for selecting a subset of the nonnullable columns that are to be reflected in the overqualified update statement that is generated in the deployment code to support optimistic policies.

A entity that is configured with a read-only policy that causes a bean to be activated can cause problems if updates are attempted within the same transaction. Those changes are not committed, and an exception is thrown because data integrity might be compromised.

Use access intent policies to help the run time environment manage various aspects of Enterprise JavaBeans (EJB) persistence. You apply access intent policies to methods of EJB Version 2.0 entity beans by using the Application Assembly Tool. WAS provides a set of default access intent policies.

For more information on access intent policies, see these topics:

Read-ahead hints
This topic describes read-ahead hints that enable applications to minimize the number of database roundtrips by retrieving a working set of container-managed persistence (CMP) beans for the transaction within one query.

Apply access intent policies to methods
This topic describes how to apply an access intent policy to a method, or set of methods, in an application's entity beans through the Application Assembly Tool (AAT).

Access intent exceptions
This topic describes the exceptions that are thrown in response to the application of access intent policies.

Access intent best practices
This topic outlines issues to consider when applying access intent policies to Enterprise JavaBeans (EJB) methods.