Edit

Share via


InstancePersistenceContext.BindAcquiredLock(Int64) Method

Definition

Binds a newly acquired lock on an instance to the current instance handle. The version of the acquired lock is passed as a parameter.

public:
 void BindAcquiredLock(long instanceVersion);
public void BindAcquiredLock (long instanceVersion);
member this.BindAcquiredLock : int64 -> unit
Public Sub BindAcquiredLock (instanceVersion As Long)

Parameters

instanceVersion
Int64

Version of the lock acquired on the instance, or zero if the persistence provider does not implement lock versions.

Remarks

If a persistence provider implements lock versioning, then each time a lock is acquired on the instance, the version must be incremented by one in the external store. The first time the instance is locked, the version should be 1. Each lock acquisition invalidates the previous lock. The current instance handle must be bound to an instance and a lock owner. The instance must not be completed. The lock token associated with the lock owner is used to identify the owner of the lock

Once a lock is bound to a handle, it remains bound for the lifetime of the handle. Neither the lock token nor the instance version can be changed.

Applies to