InstancePersistenceContext.CreateBindReclaimedLockException(Int64) 方法

定义

创建可从 TryCommand 引发以触发 BindReclaimedLock 行为的异常的实例。

public:
 Exception ^ CreateBindReclaimedLockException(long instanceVersion);
public Exception CreateBindReclaimedLockException(long instanceVersion);
member this.CreateBindReclaimedLockException : int64 -> Exception
Public Function CreateBindReclaimedLockException (instanceVersion As Long) As Exception

参数

instanceVersion
Int64

实例上保留的锁版本;如果持久性提供程序未实现锁定版本,则为零。

返回

异常。

注解

示例代码:

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

等效于:

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

适用于