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
We are having a problem in a high concurrency environment when trying to use DbConnection.InsertAsync. Further inspection showed that the issue is with TableInfo._cache which is a Dictionary instead of ConcurrentDictionary (a change like this was applied in v3.3.3 on TableInfoFactory). It looks like TableInfos are fetched from the factory where the cache is using ConcurrentDictionary (so we can have multiple references from different threads to the same TableInfo), but the TableInfo's internal cache is of Dictionary<string,TableSqlCache> type.
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.ListUtils.GetValueOrCreate[T,V](IDictionary2 dict, T key, Func1 factory) at SqlFu.Builders.Crud.InsertSqlBuilder.GetCommandConfiguration() at SqlFu.CrudHelpers.InsertAsync[T](DbConnection db, T data, CancellationToken cancel, Action1 cfg)
The text was updated successfully, but these errors were encountered:
We are having a problem in a high concurrency environment when trying to use DbConnection.InsertAsync. Further inspection showed that the issue is with TableInfo._cache which is a Dictionary instead of ConcurrentDictionary (a change like this was applied in v3.3.3 on TableInfoFactory). It looks like TableInfos are fetched from the factory where the cache is using ConcurrentDictionary (so we can have multiple references from different threads to the same TableInfo), but the TableInfo's internal cache is of Dictionary<string,TableSqlCache> type.
The text was updated successfully, but these errors were encountered: