Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.toplink.descriptors
Class PessimisticLockingPolicy

`java.lang.Object
oracle.toplink.descriptors.PessimisticLockingPolicy`

All Implemented Interfaces:
  java.lang.Cloneable, java.io.Serializable

public class PessimisticLockingPolicy
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Description: This policy is used to configure bean level pessimistic locking feautre. It is set on the CMPPolicy instance of the Descriptor Note that bean is not pessimistic locked in the following scenarios:

- No presence of a JTA transaction
- The current transaction is created and started by the Container for the invoking entity bean's method only. (i.e. invoke a business method without a client transaction)
- The bean has already been pessimistic locked in the current transaction
- Execution of ejbSelect
- Traversing relationship does not lock the returned result.

Responsibilities:

- Configure locking modes of WAIT or NO_WAIT
- Provide utitity to configure an ObjectLevelReadQuery with pessimstic locking based on this policy.

Since:
  TopLink 10.1.3
See Also:
  `CMPPolicy`, Serialized Form

Constructor Summary
`PessimisticLockingPolicy()`

Method Summary
`short` | `getLockingMode()` PUBLIC: Return locking mode.
`void` | `setLockingMode(short mode)` PUBLIC: Set locking mode.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PessimisticLockingPolicy

    public PessimisticLockingPolicy()

Method Detail

### getLockingMode

    public short getLockingMode()

  PUBLIC: Return locking mode. Default locking mode is ObjectLevelReadQuery.LOCK.
  Returns:
    short locking mode value of ObjectLevelReadQuery.LOCK or ObjectLevelReadQuery.LOCK_NOWAIT

### setLockingMode

    public void setLockingMode(short mode)

  PUBLIC: Set locking mode. If the mode is not a valid value, the locking mode is unchanged.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD