Index: /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs	(revision 1154)
+++ /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs	(revision 1155)
@@ -41,6 +41,6 @@
     private static bool cacheFilled = false;
 
-    private static ReaderWriterLock cacheLock =
-      new ReaderWriterLock();
+    private static ReaderWriterLockSlim cacheLock =
+      new ReaderWriterLockSlim();
 
     protected DataTable dataTable =
@@ -51,5 +51,5 @@
 
     protected CachedDataAdapter() {
-      cacheLock.AcquireWriterLock(Timeout.Infinite);
+      cacheLock.EnterWriteLock();
 
       if (!cacheFilled) {
@@ -58,5 +58,5 @@
       }
 
-      cacheLock.ReleaseWriterLock();
+      cacheLock.ExitWriteLock();
 
       ServiceLocator.GetTransactionManager().OnUpdate +=
@@ -66,5 +66,5 @@
     protected virtual RowT FindSingleRow(Selector dbSelector,
       Selector cacheSelector) {
-      cacheLock.AcquireReaderLock(Timeout.Infinite);
+      cacheLock.EnterReadLock();
       
       RowT row =
@@ -77,5 +77,5 @@
       }
 
-      cacheLock.ReleaseReaderLock();
+      cacheLock.ExitReadLock();
 
       return row;
@@ -84,5 +84,5 @@
     protected virtual IEnumerable<RowT> FindMultipleRows(Selector dbSelector,
         Selector cacheSelector) {
-      cacheLock.AcquireReaderLock(Timeout.Infinite);
+      cacheLock.EnterReadLock();
 
       IList<RowT> result =
@@ -98,5 +98,5 @@
       }
 
-      cacheLock.ReleaseReaderLock();
+      cacheLock.ExitReadLock();
 
       return result;
@@ -107,5 +107,5 @@
       ObjT obj = default(ObjT);
 
-      cacheLock.AcquireReaderLock(Timeout.Infinite);
+      cacheLock.EnterReadLock();
 
       RowT row = FindSingleRow(dbSelector, cacheSelector);
@@ -116,5 +116,5 @@
       }
 
-      cacheLock.ReleaseReaderLock();
+      cacheLock.ExitReadLock();
 
       return obj;
@@ -123,5 +123,5 @@
     protected virtual ICollection<ObjT> FindMultiple(Selector dbSelector,
       Selector cacheSelector) {
-      cacheLock.AcquireReaderLock(Timeout.Infinite);
+      cacheLock.EnterReadLock();
 
       ICollection<ObjT> result =
@@ -131,5 +131,5 @@
         FindMultiple(dbSelector);
 
-      cacheLock.ReleaseReaderLock();
+      cacheLock.ExitReadLock();
 
       foreach (ObjT obj in resultDb) {
@@ -156,9 +156,9 @@
       }
 
-      cacheLock.AcquireReaderLock(Timeout.Infinite);
+      cacheLock.EnterReadLock();
 
       this.SynchronizeWithDb();
 
-      cacheLock.ReleaseReaderLock();
+      cacheLock.ExitReadLock();
     }
 
@@ -171,9 +171,9 @@
         return false;
       else {
-        cacheLock.AcquireReaderLock(Timeout.Infinite);
+        cacheLock.EnterReadLock();
 
         bool cached = FindCachedById((long)row[row.Table.PrimaryKey[0]]) != null;
 
-        cacheLock.ReleaseReaderLock();
+        cacheLock.ExitReadLock();
 
         return cached;
@@ -182,5 +182,5 @@
 
     protected override RowT GetRowById(long id) {
-      cacheLock.AcquireReaderLock(Timeout.Infinite);
+      cacheLock.EnterReadLock();
 
       RowT row =
@@ -194,5 +194,5 @@
           });
 
-      cacheLock.ReleaseReaderLock();
+      cacheLock.ExitReadLock();
 
       return row;
@@ -200,18 +200,18 @@
 
     private void AddToCache(RowT row) {
-      cacheLock.AcquireWriterLock(Timeout.Infinite);
+      cacheLock.EnterWriteLock();
 
       cache.ImportRow(row);
       row.Table.Rows.Remove(row);
 
-      cacheLock.ReleaseWriterLock();
+      cacheLock.ExitWriteLock();
     }
 
     private RowT AddToCache(ObjT obj) {
-      cacheLock.AcquireWriterLock(Timeout.Infinite);
+      cacheLock.EnterWriteLock();
 
       RowT row =  InsertNewRowInCache(obj);
 
-      cacheLock.ReleaseWriterLock();
+      cacheLock.ExitWriteLock();
 
       return row;
@@ -219,10 +219,10 @@
 
     private void RemoveRowFromCache(RowT row) {
-      cacheLock.AcquireWriterLock(Timeout.Infinite);
+      cacheLock.EnterWriteLock();
 
       dataTable.ImportRow(row);
       cache.Rows.Remove(row);
 
-      cacheLock.ReleaseWriterLock();
+      cacheLock.ExitWriteLock();
 
       UpdateRow(row);
