- Timestamp:
- 01/15/09 17:11:13 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs
r1146 r1149 141 141 protected abstract void FillCache(); 142 142 143 p ublic abstract void SyncWithDb();143 protected abstract void SynchronizeWithDb(); 144 144 145 145 protected abstract bool PutInCache(ObjT obj); … … 147 147 protected abstract RowT FindCachedById(long id); 148 148 149 public void SyncWithDb() { 150 foreach (ICachedDataAdapter parent in this.parentAdapters) { 151 parent.SyncWithDb(); 152 } 153 154 cacheLock.AcquireReaderLock(Timeout.Infinite); 155 156 this.SynchronizeWithDb(); 157 158 cacheLock.ReleaseReaderLock(); 159 } 160 149 161 void CachedDataAdapter_OnUpdate(object sender, EventArgs e) { 150 foreach (ICachedDataAdapter parent in this.parentAdapters) {151 parent.SyncWithDb();152 }153 154 cacheLock.AcquireReaderLock(Timeout.Infinite);155 156 162 this.SyncWithDb(); 157 158 cacheLock.ReleaseReaderLock();159 163 } 160 164 … … 162 166 if (row == null) 163 167 return false; 164 else 165 return FindCachedById((long)row[row.Table.PrimaryKey[0]]) != null; 168 else { 169 cacheLock.AcquireReaderLock(Timeout.Infinite); 170 171 bool cached = FindCachedById((long)row[row.Table.PrimaryKey[0]]) != null; 172 173 cacheLock.ReleaseReaderLock(); 174 175 return cached; 176 } 166 177 } 167 178
Note: See TracChangeset
for help on using the changeset viewer.