Exemple #1
0
 /// <summary>
 ///   11/7/2011
 ///   Checks whether a write lock requests conflicts with existing locks.
 ///   In the case that the item is locked due to recovery, we unlock the item and return false i.e. there are no conflicts.
 /// </summary>
 /// <param name = "requestedLock">The requested lock.</param>
 /// <param name = "entry">The lock table entry to test.</param>
 /// <returns>True if the requested write lock conflicts with any existing locks</returns>
 /// <remarks>
 ///   Side effect: if the lock was held by the LM due to recovery, the lock will be removed
 /// </remarks>
 private bool WriteLockConflicts(Lock requestedLock, LockManagerTableEntry entry)
 {
     int? conflictingTransaction = entry.FindConflictsToWriteLock(requestedLock.TransactionId);
     if (conflictingTransaction == null)
         return false;
     if (conflictingTransaction == int.MinValue)
     {
         entry.RemoveLock(int.MinValue);
         return false;
     }
     return true;
 }
Exemple #2
0
 /// <summary>
 ///   Date: 10/16/2011
 ///   Removes all locks which a transaction holds on a data item
 /// </summary>
 /// <param name = "entry">The lock entry.</param>
 /// <param name = "transId">The transaction'd ID.</param>
 /// <remarks>
 ///   Side effects: All locks held by this transaction for this data item are removed
 /// </remarks>
 private static void RemoveLock(LockManagerTableEntry entry, int transId)
 {
     entry.RemoveLock(transId);
 }