InstancePersistenceContext.CreateBindReclaimedLockException(Int64) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建可从 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();
}