Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs	(revision 1169)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs	(revision 1175)
@@ -227,6 +227,13 @@
     public override void Update(ObjT obj) {
       if (obj != null) {
-        RowT row =
-          GetRowById(obj.Id);
+        RowT row = null;
+        long locked = default(long);
+
+        if (obj.Id != default(long)) {
+          LockRow(obj.Id);
+          locked = obj.Id;
+
+          row = GetRowById(obj.Id);
+        }
 
         if (row == null) {
@@ -238,8 +245,11 @@
 
           UpdateRow(row);
-        }
-
-        obj.Id = (long)row[row.Table.PrimaryKey[0]];
-        LockRow(obj.Id);
+          obj.Id = (long)row[row.Table.PrimaryKey[0]];
+        }
+
+        if (locked == default(long)) {
+          LockRow(obj.Id);
+          locked = obj.Id;
+        }
 
         ConvertObj(obj, row);
@@ -256,5 +266,5 @@
         }
 
-        UnlockRow(obj.Id);
+        UnlockRow(locked);
       }
     }
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs	(revision 1169)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs	(revision 1175)
@@ -27,5 +27,4 @@
 using HeuristicLab.Hive.Contracts.BusinessObjects;
 using System.Linq.Expressions;
-using System.Runtime.CompilerServices;
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
@@ -79,10 +78,8 @@
 
     private void Preprocess(ClientInfo client) {
-      if (client != null) {
-        if (client.Id == default(long)) {
-          ClientInfo found = GetById(client.ClientId);
-          if (found != null)
-            client.Id = found.Id;
-        }
+      if (client != null && client.Id == default(long)) {
+        ClientInfo found = GetById(client.ClientId);
+        if (found != null)
+          client.Id = found.Id;
       }
     }
@@ -215,7 +212,12 @@
 
     #region IClientAdapter Members
-    [MethodImpl(MethodImplOptions.Synchronized)]
     public override void Update(ClientInfo client) {
       if (client != null) {
+        Guid locked = Guid.Empty;
+        if (client.ClientId != Guid.Empty) {
+          LockRow(client.ClientId);
+          locked = client.ClientId;
+        }
+
         Preprocess(client);
 
@@ -223,4 +225,8 @@
 
         base.Update(client);
+
+        if (locked != Guid.Empty) {
+          UnlockRow(locked);
+        }
       }
     }
@@ -248,7 +254,14 @@
     }
 
-    [MethodImpl(MethodImplOptions.Synchronized)]
-    public override bool Delete(ClientInfo client) {      
+    public override bool Delete(ClientInfo client) {
+      bool success = false;
+      Guid locked = Guid.Empty;
+      
       if (client != null) {
+        if (client.ClientId != Guid.Empty) {
+          LockRow(client.ClientId);
+          locked = client.ClientId;
+        }
+
         Preprocess(client);
 
@@ -264,10 +277,14 @@
           }
 
-          return base.Delete(client) && 
+          success = base.Delete(client) && 
             ResAdapter.Delete(client);
         }
       }
 
-      return false;
+      if (locked != Guid.Empty) {
+        UnlockRow(locked);
+      }
+
+      return success;
     }
 
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientGroupAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientGroupAdapter.cs	(revision 1169)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientGroupAdapter.cs	(revision 1175)
@@ -27,5 +27,4 @@
 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
-using System.Runtime.CompilerServices;
 using System.Data;
 
@@ -233,5 +232,4 @@
 
     #region IClientGroupAdapter Members
-    [MethodImpl(MethodImplOptions.Synchronized)]
     public override void Update(ClientGroup group) {
       if (group != null) {
@@ -273,5 +271,4 @@
     }
 
-    [MethodImpl(MethodImplOptions.Synchronized)]
     public override bool Delete(ClientGroup group) {
       if (group != null) {
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/DataAdapterBase.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/DataAdapterBase.cs	(revision 1169)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/DataAdapterBase.cs	(revision 1175)
@@ -37,11 +37,11 @@
       new Mutex();
 
-    private static IDictionary<long, Mutex> lockers =
-      new Dictionary<long, Mutex>();
-
-    private static IDictionary<long, int> lockCount =
-      new Dictionary<long, int>();
-
-    protected void LockRow(long id) {
+    private static IDictionary<object, Mutex> lockers =
+      new Dictionary<object, Mutex>();
+
+    private static IDictionary<object, int> lockCount =
+      new Dictionary<object, int>();
+
+    protected void LockRow(object id) {
       Mutex rowLock = null;
 
@@ -62,5 +62,5 @@
     }
 
-    protected void UnlockRow(long id) {
+    protected void UnlockRow(object id) {
       Mutex rowLock = lockers[id];
       rowLock.ReleaseMutex();
@@ -163,19 +163,30 @@
     public virtual void Update(ObjT obj) {
       if (obj != null) {
-        RowT row =
-          GetRowById(obj.Id);
+        RowT row = null;
+        long locked = default(long);
+        
+        if (obj.Id != default(long)) {
+           LockRow(obj.Id);
+           locked = obj.Id;
+
+           row = GetRowById(obj.Id);
+        }          
 
         if (row == null) {
           row = InsertNewRow(obj);
           UpdateRow(row);
+
+          obj.Id = (long)row[row.Table.PrimaryKey[0]];
         }
 
-        obj.Id = (long)row[row.Table.PrimaryKey[0]];
-        LockRow(obj.Id);
+        if (locked == default(long)) {
+          LockRow(obj.Id);
+          locked = obj.Id;
+        }
 
         ConvertObj(obj, row);
         UpdateRow(row);
 
-        UnlockRow(obj.Id);
+        UnlockRow(locked);
       }
     }
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/JobAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/JobAdapter.cs	(revision 1169)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/JobAdapter.cs	(revision 1175)
@@ -27,5 +27,4 @@
 using HeuristicLab.Hive.Contracts.BusinessObjects;
 using System.Linq.Expressions;
-using System.Runtime.CompilerServices;
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
@@ -119,5 +118,8 @@
           job.DateCalculated = DateTime.MinValue;
 
-        job.Priority = row.Priority;
+        if (!row.IsPriorityNull())
+          job.Priority = row.Priority;
+        else
+          job.Priority = default(int);
 
         return job;
@@ -332,5 +334,4 @@
     }
 
-    [MethodImpl(MethodImplOptions.Synchronized)]
     public override bool Delete(Job job) {
       if (job != null) {
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/PermissionOwnerAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/PermissionOwnerAdapter.cs	(revision 1169)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/PermissionOwnerAdapter.cs	(revision 1175)
@@ -27,5 +27,4 @@
 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
-using System.Runtime.CompilerServices;
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ResourceAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ResourceAdapter.cs	(revision 1169)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ResourceAdapter.cs	(revision 1175)
@@ -26,5 +26,4 @@
 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
-using System.Runtime.CompilerServices;
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserAdapter.cs	(revision 1169)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserAdapter.cs	(revision 1175)
@@ -27,5 +27,4 @@
 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
-using System.Runtime.CompilerServices;
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
@@ -136,5 +135,4 @@
     #region IUserAdapter Members
 
-    [MethodImpl(MethodImplOptions.Synchronized)]
     public override void Update(User user) {
       if (user != null) {
@@ -156,5 +154,4 @@
     }
 
-    [MethodImpl(MethodImplOptions.Synchronized)]
     public override bool Delete(User user) {
       if (user != null) {
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserGroupAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserGroupAdapter.cs	(revision 1169)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserGroupAdapter.cs	(revision 1175)
@@ -27,5 +27,4 @@
 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
-using System.Runtime.CompilerServices;
 using System.Data;
 
@@ -234,5 +233,4 @@
 
     #region IUserGroupAdapter Members
-    [MethodImpl(MethodImplOptions.Synchronized)]
     public override void Update(UserGroup group) {
       if (group != null) {
@@ -273,5 +271,4 @@
     }
 
-    [MethodImpl(MethodImplOptions.Synchronized)]
     public override bool Delete(UserGroup group) {
       if (group != null) {
