InstancePersistenceContext.CreateBindReclaimedLockException(Int64) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an instance of an exception which can be thrown from TryCommand to trigger BindReclaimedLock behavior.
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
The version of the lock held on the instance, or zero if the persistence provider does not implement lock versions.
Returns
An exception.
Remarks
Sample code:
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();
}
Applies to
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.