InstancePersistenceContext.CreateBindReclaimedLockException(Int64) Methode

Definitie

Hiermee maakt u een exemplaar van een uitzondering die kan worden gegenereerd vanuit TryCommand om bindReclaimedLock-gedrag te activeren.

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

De versie van de vergrendeling op het exemplaar of nul als de persistentieprovider geen vergrendelingsversies implementeert.

Retouren

Een uitzondering.

Opmerkingen

Voorbeeldcode:

protected override bool TryCommand(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout)
{
    throw context.CreateBindReclaimedLockException(5);
}

Is gelijk aan:

protected override bool TryCommand(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout)
{
    context.BindReclaimedLock(5, timeout);
    throw new OperationCanceledException();
}

Van toepassing op