ActiveDirectoryHelper.GetEmailAddress() contains a race condition. The code calls CacheMgr.Contains(name), then runs a Trace.WriteLine(), then calls CacheMgr.GetData(). Between the two calls the data may expire and drop out of the cache, resulting in GetData() returning null. We sometimes see NULL values in the database in AlertEmail.To. The corrected code is:string cachedEmail = (string)CacheMgr.GetData(name);if (!string.IsNullOrEmpty(cachedEmail)){ System.Diagnostics.Trace.WriteLine("Reusing email address for " + name + " from cache."); return cachedEmail;}
Product Language
Version
Category
Repro Steps