Hi folks:
Our production repeatedly met "Hashtable insert failed. Load factor too high". 1. How could I simulate this kind of exception? 2. If this sort of exception is thrown, would the existing key/value will disappear?
Thanks for any help.
Hi folks:
Our production repeatedly met "Hashtable insert failed. Load factor too high". 1. How could I simulate this kind of exception? 2. If this sort of exception is thrown, would the existing key/value will disappear?
Thanks for any help.
In .NET 2.0, this error is almost always caused by multiple threads modifying the Hashtable at the same time.
There is a HotFix for .NET 3.5
See Hashtable insert failed. Load factor too high and FIX: "InvalidOperationException, Load Factor Too High" When You Use a Hashtable Collection
This contains a relevant explanation: http://blogs.msdn.com/toddca/archive/2007/01/26/hashtable-insert-failed-load-factor-too-high.aspx