Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Item already added error
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
ASP.NET
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01169219
Message ID:
01169724
Views:
7
Jim,

>Our website sproradically gets an "Item has already been added. Key in dictionary:" error. I have tracked it down to the OakLeaf.MM.Main.Managers.mmDatabaseManager.GetConnectionString(String databaseKey) method calling System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add). I have a feeling that two website users are attempting to access a database key for the first time at the same time and one of them is inserting the key into the cache before the other user and the second user is getting this error. Does anyone else have this problem?

I haven't seen this before...are you using MM .NET version 2.2? The GetConnectionString method uses code that retrieves a thread-safe version of the ConnectionString HashTable before checking if the value already exists and adding the connection if it doesn't.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform