We are experiencing some problems when accessing items using a Timer which is not consistent for all items. We have the following code:
var database =Sitecore.Configuration.Factory.GetDatabase(indexItem.TargetDatabase);
var item = database.GetItem(indexItem.Id, indexItem.Language);
if(item == null)
{
Diagnostics(indexItem.WithDiagnostics, "Item missing in database {0}:{1}:{2}", indexItem.TargetDatabase, indexItem.Id, indexItem.Language);
}
For the item /sitecore/content/site/home it works, however for the item /sitecore/content/site/home/page1 it fails. This is the same if we access master or web.
Testing the above code in a webpage it works fine for both items on master and web, it just seems to be on the timer event that it fails.
The failure is consistent for each item, i.e. it always fails or it always succeeds.
The time is implemented as follows:
_processingTimer = new System.Timers.Timer(processingInterval);
_processingTimer.Elapsed += (obj, args) => ProcessQueue(queueStartParams);
_processingTimer.AutoReset = true;
_processingTimer.Start();
Anyone know of any issues related to threading and events in SC?