{_typeNames.Add(typeName.typeName, typeName)} (line 707) can (and will im my case) be called concurrent by two different threads => {"An item with the same key has already been added."}.
there is no mutex and the {if (_typeNames == null)} is not good enough.
occurs in an NHibernate environment where two requests (queries) will be executed/started at the same time(millis).
workaround: execute a single initial query to initialize the static {private static Dictionary<string, SQLiteTypeNames> _typeNames}
<hr /><i>anonymous claiming to be Alex Spence added on 2011-10-28 00:23:21 UTC:</i><br />
Seems like the dictionary should just be initialized in a static constructor, then you don't have to worry about it being thread safe as you wont be writing to it.
<hr /><i>mistachkin added on 2011-10-28 13:31:47 UTC:</i><br />
Duplicate of [84718e79fa], already fixed by check-in [13a3981ec0].
|