Class PessimisticLockingPolicy
- java.lang.Object
-
- org.eclipse.persistence.descriptors.PessimisticLockingPolicy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
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 feature. It is set on the CMPPolicy instance of the ClassDescriptor 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 utility to configure an ObjectLevelReadQuery with pessimistic locking based on this policy.
- See Also:
CMPPolicy
, Serialized Form- Since:
- TopLink 10.1.3
-
-
Field Summary
Fields Modifier and Type Field Description protected short
lockingMode
-
Constructor Summary
Constructors Constructor Description PessimisticLockingPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
INTERNAL: Clone the policyshort
getLockingMode()
PUBLIC: Return locking mode.void
setLockingMode(short mode)
PUBLIC: Set locking mode.
-
-
-
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:
mode
- must be value of ObjectLevelReadQuery.LOCK or ObjectLevelReadQuery.LOCK_NOWAIT
-
clone
public java.lang.Object clone()
INTERNAL: Clone the policy- Overrides:
clone
in classjava.lang.Object
-
-