You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I think there is a bug in DictionaryAdapper - particulary in DictionaryAdapterInstance class (or ComponentAttribute class depending on approach :)).
Extended properties is instantianted as Dictionary wich is not thread safe.
which writes to Dictionary and it causes occasionally a exception in multihread environment (web page in my case).
Stack trase from my app:
System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
at System.Collections.Generic.Dictionary`2.System.Collections.IDictionary.get_Item(Object key)
at Castle.Components.DictionaryAdapter.ComponentAttribute.Castle.Components.DictionaryAdapter.IDictionaryPropertyGetter.GetPropertyValue(IDictionaryAdapter dictionaryAdapter, String key, Object storedValue, PropertyDescriptor property, Boolean ifExists)
at Castle.Components.DictionaryAdapter.PropertyDescriptor.GetPropertyValue(IDictionaryAdapter dictionaryAdapter, String key, Object storedValue, PropertyDescriptor descriptor, Boolean ifExists)
at Castle.Components.DictionaryAdapter.DictionaryAdapterBase.GetProperty(String propertyName, Boolean ifExists)
at CastleDictionaryAdapterType.get_AppPath()
The code should be fixed to be thread safe in that place.
The text was updated successfully, but these errors were encountered:
Hi @jakubs79, I'm not overly familiar with DictionaryAdapter (I've never used it myself) and I'm not even 100 % sure whether we're still maintaining that thing (see #394 about that), but just in case we do: Could you please add a minimal but complete code example that reproduces this exception? Thanks.
Hi, I think there is a bug in DictionaryAdapper - particulary in DictionaryAdapterInstance class (or ComponentAttribute class depending on approach :)).
Extended properties is instantianted as Dictionary wich is not thread safe.
My interface (some code omitted for clarity) is defined as
and is initialized on startup and used as singleton
In ComponentAttribute class there is such code:
which writes to Dictionary and it causes occasionally a exception in multihread environment (web page in my case).
Stack trase from my app:
The code should be fixed to be thread safe in that place.
The text was updated successfully, but these errors were encountered: