/// <summary> /// Releases the lock on the <b>Entity</b>. /// </summary> /// <remarks> /// The <see cref="Jhu.Graywulf.Registry.Context.JobGuid" /> property of the context must be set. /// </remarks> /// <exception cref="InvalidConcurrencyVersionException"></exception> /// <exception cref="LockingCollisionException"></exception> public void ReleaseLock(bool forceRelease) { try { ReleaseLockRecursively(forceRelease); } catch (LockingCollisionException) { Context.RollbackTransaction(); throw; } catch (InvalidConcurrencyVersionException) { Context.RollbackTransaction(); throw; } }
/// <summary> /// Obtains a lock for the <b>Entity</b>. /// </summary> /// <remarks> /// The <see cref="Context.JobGuid" /> property of the context must be set. /// </remarks> /// <exception cref="InvalidConcurrencyVersionException"></exception> /// <exception cref="LockingCollisionException"></exception> public void ObtainLock() { try { ObtainLockRecursively(); } catch (LockingCollisionException) { Context.RollbackTransaction(); throw; } catch (InvalidConcurrencyVersionException) { Context.RollbackTransaction(); throw; } }