Error in method CanReadProperty(Csla.Core.IPropertyInfo property) of Csla.Core.BusinessBase

Error in method CanReadProperty(Csla.Core.IPropertyInfo property) of Csla.Core.BusinessBase

Old forum URL: forums.lhotka.net/forums/t/11516.aspx


eduardo.micromust posted on Monday, August 06, 2012

CanReadProperty(Csla.Core.IPropertyInfo property) uses Dictionary<string, bool> but this class is not thread safe resulting in hard to reproduce "System.IndexOutOfRangeException" in line "_readResultCache[property.Name] = result;".

I suggest using "ConcurrentDictionary<stringbool>" ( which is thread safe) in read, write and execute caches.

eduardo.micromust replied on Monday, August 06, 2012

ConcurrentDictionary is not supported in Silverlight. It will be necessary to use the traditional lock statement.

RockfordLhotka replied on Monday, August 06, 2012

CSLA objects are not threadsafe. There is no attempt to make the entire framework threadsafe. This is primarily because none of the .NET UI techologies are threadsafe either, nor is ADO.NET. In other words, even if CSLA was threadsafe, and we accepted the resulting perf penalties, it wouldn't really matter because most of .NET itself isn't threadsafe.

Copyright (c) Marimer LLC