Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1093 for trunk


Ignore:
Timestamp:
01/08/09 14:52:17 (15 years ago)
Author:
svonolfe
Message:

Added lock to avoid race conditions (#372).

Location:
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs

    r1088 r1093  
    8585    }
    8686
    87     [MethodImpl(MethodImplOptions.Synchronized)]
    8887    protected virtual ObjT FindSingle(Selector dbSelector,
    8988      Selector cacheSelector) {
     
    117116    }
    118117
     118    [MethodImpl(MethodImplOptions.Synchronized)]
    119119    protected abstract RowT InsertNewRowInCache(ObjT obj);
    120120
     121    [MethodImpl(MethodImplOptions.Synchronized)]
    121122    protected abstract void FillCache();
    122123
     124    [MethodImpl(MethodImplOptions.Synchronized)]
    123125    public abstract void SyncWithDb();
    124126
     127    [MethodImpl(MethodImplOptions.Synchronized)]
    125128    protected abstract bool PutInCache(ObjT obj);
    126129
     130    [MethodImpl(MethodImplOptions.Synchronized)]
    127131    protected abstract RowT FindCachedById(long id);
    128132
     133    [MethodImpl(MethodImplOptions.Synchronized)]
    129134    void CachedDataAdapter_OnUpdate(object sender, EventArgs e) {
    130135      foreach (ICachedDataAdapter parent in this.parentAdapters) {
     
    135140    }
    136141
     142    [MethodImpl(MethodImplOptions.Synchronized)]
    137143    protected virtual void RemoveRowFromCache(RowT row) {     
    138144      cache.Rows.Remove(row);
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/DataAdapterBase.cs

    r1088 r1093  
    4040    protected abstract ObjT Convert(RowT row, ObjT obj);
    4141
     42    [MethodImpl(MethodImplOptions.Synchronized)]
    4243    protected abstract RowT InsertNewRow(ObjT obj);
    4344
     45    [MethodImpl(MethodImplOptions.Synchronized)]
    4446    protected abstract void UpdateRow(RowT row);
    4547
     48    [MethodImpl(MethodImplOptions.Synchronized)]
    4649    protected abstract IEnumerable<RowT> FindById(long id);
    4750
     51    [MethodImpl(MethodImplOptions.Synchronized)]
    4852    protected abstract IEnumerable<RowT> FindAll();
    4953    #endregion
     
    6468    }
    6569
    66     [MethodImpl(MethodImplOptions.Synchronized)]
    6770    protected virtual ObjT FindSingle(Selector selector) {
    6871      RowT row = FindSingleRow(selector);
     
    9598    }
    9699
    97     [MethodImpl(MethodImplOptions.Synchronized)]
    98100    protected virtual RowT GetRowById(long id) {
    99101      return FindSingleRow(
     
    121123    }
    122124
    123     [MethodImpl(MethodImplOptions.Synchronized)]
    124125    public virtual ObjT GetById(long id) {
    125126      return FindSingle(delegate() {
     
    128129    }
    129130
    130     [MethodImpl(MethodImplOptions.Synchronized)]
    131131    public virtual ICollection<ObjT> GetAll() {
    132132      return new List<ObjT>(
Note: See TracChangeset for help on using the changeset viewer.