Access intent policies contain data-access settings for use by the persistence manager. Specify one or more methods and associate an access intent policy with each method.
These settings are applicable only for EJB 2.x-compliant entity beans that are packaged in EJB 2.x-compliant modules. Connection sharing between beans with bean-managed persistence and those with container-managed persistence is possible if they all use the same access intent policy.
Data type | String |
Range | Valid values are Home, Remote,Local, LocalHome or Unspecified |
Data type | String |
Default | wsPessimisticUpdate-WeakestLockAtLoad. However, this policy cannot be used with Oracle; see the table that follows. |
Range | Valid settings are wsPessimisticUpdate, wsPessimisticUpdate-NoCollision, wsPessimisticUpdate-Exclusive, wsPessimisticUpdate-WeakestLockAtLoad, wsPessimisticRead, wsOptimisticUpdate, or wsOptimisticRead. Only wsPessimisticRead and wsOptimisticRead are valid when class-level caching is enabled in the EJB container. |
This product supports lazy collections. For each segment of a collection, iterating through the collection (next()) does not trigger a remote method call to retrieve the next remote reference. Two policies (wsPessimisticUpdate and wsPessimisticUpdate-Exclusive) are extremely lazy; the collection increment size is set to 1 to avoid overlocking the application. The other policies have a collection increment size of 25.
If a method is not configured with an access intent policy, the run-time environment typically uses wsPessimisticUpdate-WeakestLockAtLoad by default. If, however, the Lifetime in cache property is set on the bean, the default value of Applied access intent is wsOptimisticRead; updates are not permitted. If a method of a Lifetime in cache-configured bean is configured with an access intent policy that permits updates, the application will not run until the method or bean is reconfigured.
Additional information about valid settings follows:
Profile name | Concurrency control | Access type | Transaction isolation |
---|---|---|---|
wsPessimisticRead (Note 1) | pessimistic | read | For Oracle, read committed. Otherwise, repeatable read |
wsPessimisticUpdate (Note 2) | pessimistic | update | For Oracle, read committed. Otherwise, repeatable read |
wsPessimisticUpdate- Exclusive (Note 3) | pessimistic | update | serializable |
wsPessimisticUpdate- NoCollision (Note 4) | pessimistic | update | read committed |
wsPessimisticUpdate- WeakestLockAtLoad (Note 5) | pessimistic | update | Repeatable read |
wsOptimisticRead | optimistic | read | read committed |
wsOptimisticUpdate (Note 6) | optimistic | update | read committed |
Notes:
|