Closed GoogleCodeExporter closed 8 years ago
Hmmm, indeed. Originally this was essentially internal only, but the addition
of AddTypeMap requires synchronisation. I would, however, be keep to avoid any
unnecessary overheads here. It is a shame that the value here is value-typed,
otherwise Hashtable could be used very effectively (it has very good threading
semantics). I suspect the most appropriate "fix" here is for `AddTypeMap` to
*clone, mutate and replace* the dictionary - avoiding any need for
thread-safety for readers (a dereference is always safe).
Original comment by marc.gravell
on 25 Nov 2013 at 2:45
I agree that clone, mutate and replace is probably the way to go.
And perhaps add a public overload AddTypeMap(IEnumerable<KeyValuePair<Type,
DbType>) so that a caller can more efficiently add multiple entries to the
dictionary.
Original comment by Jocular...@hotmail.com
on 25 Nov 2013 at 4:35
Implemented for both type-map and type-handlers
Original comment by marc.gravell
on 5 Aug 2014 at 3:43
Original issue reported on code.google.com by
Jocular...@hotmail.com
on 25 Nov 2013 at 2:34