WAS v8.5 > Develop applications > Develop data access resources > Develop data access applications > Develop data access applications > Benefits of resource references > Requirements for setting data access isolation levelsAccess intent service
The access intent service enables developers to precisely tune the management of application persistence.
Access intent enables developers to configure applications so the EJB container and its agents can make performance optimizations for entity bean access. Entity beans and entity bean methods are configured with access intent policies. A policy is acted upon by either the combination of the WebSphere EJB container and Persistence Manager (for container-managed persistence entities) or by bean-managed persistence (BMP) entities directly. Note that access intent policies apply to entity beans only.
Predefined access intent policies
Seven predefined access intent policies are available. The policies are composed of different attributes. The access type is of primary interest and controls the isolation level, lock type, and duration of locks obtained when bean data is read from the database.
A pessimistic access type indicates to hold locks for the duration of the transaction under which the data loads. An optimistic type indicates to drop locks immediately after the data is read from the backend. A read type indicates the run time must not allow updates to the data; any attempt to do so on data read under a read type results in an exception. Update types permit you to change data.
Though a pessimistic update policy is designed to hold update locks on data records, it does not block threads with other policies that try to access the same data records. When two threads that run pessimistic update policies access a given record, they serialize (but not block) other threads that run pessimistic read or optimistic policies and try to access the same record. The seven access intent policies and their attribute definitions follow:
- wsPessimisticUpdate
- Access type = Pessimistic update
- Collection scope = Transaction
- Collection increment = 1
- Resource manager prefetch increment = 0
- Read ahead hint = null
- wsOptimisticUpdate
- Access type = Optimistic update
- Collection scope = Transaction
- Collection increment = 25
- Resource manager prefetch increment = 0
- Read ahead hint = null
- wsOptimisticRead
- Access type = Optimistic read
- Collection scope = Transaction
- Collection increment = 25
- Resource manager prefetch increment = 0
- Read ahead hint = null
- wsPessimisticRead
- Access type = Pessimistic read
- Collection scope = Transaction
- Collection increment = 25
- Resource manager prefetch increment = 0
- Read ahead hint = null
- wsPessimisticUpdate-Exclusive
- Access type = Pessimistic update
- Exclusive = true
- Collection scope = Transaction
- Collection increment = 1
- Resource manager prefetch increment = 0
- Read ahead hint = null
- wsPessimisticUpdate-NoCollision
- Access type = Pessimistic update
- No collision = true
- Collection scope = Transaction
- Collection increment = 25
- Resource manager prefetch increment = 0
- Read ahead hint = null
- wsPessimisticUpdateWeakestLockAtLoad
- *default policy
- Access type = Pessimistic Update
- Promote = true
- Collection scope = transaction
- Collection increment = 25
- Resource manager prefetch increment = 0
- Read ahead hint = null
To support connection sharing, ensure that all data loaded in the same transaction is under the same isolation level. Verify that all participating methods that drive loads are configured with either a pessimistic access type or an optimistic access type.
Subtopics
- Access intent -- isolation levels and update locks
WAS access intent policies provide a consistent way of defining the isolation level for CMP bean data across the different relational databases in the environment.- Custom finder SQL dynamic enhancement
- Access intent -- isolation levels and update locks
WAS access intent policies provide a consistent way of defining the isolation level for CMP bean data across the different relational databases in the environment.- Custom finder SQL dynamic enhancement
Related concepts:
Access intent policies for EJB 2.x entity beans
Concurrency control
Related
Applying access intent policies to methods