InstancePersistenceContext.LockToken Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the lock token of the instance owner bound to the current instance handle.
public:
property Guid LockToken { Guid get(); };
public Guid LockToken { get; }
member this.LockToken : Guid
Public ReadOnly Property LockToken As Guid
Property Value
The lock token bound to the current instance handle, or Empty if the handle isn't bound to an instance owner.
Remarks
The persistence provider should check this value against the lock token of the lock held on an instance in the instance store when performing an operation that requires a lock (such as persisting instance data) using a handle bound to the lock. If the lock token doesn't match, the command should fail with InstanceLockLostException.
The persistence provider should use this value as the lock token when acquiring a new lock on an instance (such as persisting instance data using a handle not already bound to a lock). If the instance is already locked in the instance store and the lock token matches this lock token, the persistence provider can attempt to reclaim the instance using BindReclaimedLock.