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);  
}  
is equivalent to  
protected override bool TryCommand(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout)  
{  
    context.BindReclaimedLock(5, timeout);  
    throw new OperationCanceledException();  
}  

适用于