共用方式為


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();  
}  

適用於