I'm expriencing this problem too with DataCache.GetCache(). Okay, so reorganizing the code, removes some errors due to time problems. But I think the problem is beyond only reorganizing code.
I beleive that DataCache.GetCache() and SetCache() are the most called methods in the whole Core. But, strangely, these are not multi-threading safe. Check this code:
.... DataCache.SetCache(key, obj);
Object obj2 = DataCache.GetCache(key);
return obj2; // Most of the time, this is null
So what is happening is the SetCache method is not finishing synchrounosly and safely, when GetCache() tries to get that object , and whoooops no object !!!
So what I'm suggesting is to make the DataCache multi-thread safe.
Nice work guys