org.eclipse.persistence.descriptors
Class PessimisticLockingPolicy

java.lang.Object
  extended by org.eclipse.persistence.descriptors.PessimisticLockingPolicy
All Implemented Interfaces:
Serializable, Cloneable

public class PessimisticLockingPolicy
extends Object
implements Cloneable, Serializable

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

Responsibilities:

Since:
TopLink 10.1.3
See Also:
CMPPolicy, Serialized Form

Constructor Summary
PessimisticLockingPolicy()
           
 
Method Summary
 Object clone()
          INTERNAL: Clone the policy
 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.

Parameters:
short - mode must be value of ObjectLevelReadQuery.LOCK or ObjectLevelReadQuery.LOCK_NOWAIT

clone

public Object clone()
INTERNAL: Clone the policy

Overrides:
clone in class Object