private ICachedObject GetFromFile(int pos, IPersistentStore store, bool keep) { ICachedObject obj2; Monitor.Enter(this.Lock); try { ICachedObject row = this.cache.Get(pos); if (row != null) { if (keep) { row.KeepInMemory(true); } return(row); } for (int i = 0; i < 2; i++) { try { IRowInputInterface interface2 = this.ReadObject(pos); if (interface2 == null) { return(null); } row = store.Get(interface2); break; } catch (OutOfMemoryException) { this.cache.ForceCleanUp(); if (i > 0) { throw; } } } pos = row.GetPos(); this.cache.Put(pos, row); if (keep) { row.KeepInMemory(true); } store.Set(row); obj2 = row; } catch (CoreException exception) { this.database.logger.LogSevereEvent(this.DataFileName + FwNs.Core.LC.cResources.SR.DataFileCache_GetFromFile__getFromFile_ + pos, exception); throw; } finally { Monitor.Exit(this.Lock); } return(obj2); }