Esempio n. 1
0
 /// <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;
     }
 }
Esempio n. 2
0
 /// <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;
     }
 }