InstancePersistenceContext.CreateBindReclaimedLockException(Int64) Method
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.
Creates an instance of an exception which can be thrown from TryCommand to trigger BindReclaimedLock behavior.
public:
Exception ^ CreateBindReclaimedLockException(long instanceVersion);
public Exception CreateBindReclaimedLockException (long instanceVersion);
member this.CreateBindReclaimedLockException : int64 -> Exception
Public Function CreateBindReclaimedLockException (instanceVersion As Long) As Exception
Parameters
- instanceVersion
- Int64
The version of the lock held on the instance, or zero if the persistence provider does not implement lock versions.
Returns
An exception.
Remarks
Sample code:
protected override bool TryCommand(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout)
{
throw context.CreateBindReclaimedLockException(5);
}
is equivalent to
protected override bool TryCommand(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout)
{
context.BindReclaimedLock(5, timeout);
throw new OperationCanceledException();
}
Applies to
Met ons samenwerken op GitHub
De bron voor deze inhoud vindt u op GitHub, waar u ook problemen en pull-aanvragen kunt maken en controleren. Bekijk onze gids voor inzenders voor meer informatie.