From 9dfdd7d406ae61f99fa63c710e8fc5973c7625bf Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 6 May 2007 01:43:12 +0000 Subject: [PATCH] Fixed collision error with threaded access. --- OpenGrid.Framework.Data.DB4o/DB4oGridData.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs b/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs index 63f976f107..c853b50d05 100644 --- a/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs +++ b/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs @@ -41,13 +41,16 @@ namespace OpenGrid.Framework.Data.DB4o public DataResponse AddProfile(SimProfileData profile) { - if (manager.AddRow(profile)) + lock (manager.profiles) { - return DataResponse.RESPONSE_OK; - } - else - { - return DataResponse.RESPONSE_ERROR; + if (manager.AddRow(profile)) + { + return DataResponse.RESPONSE_OK; + } + else + { + return DataResponse.RESPONSE_ERROR; + } } }