I've been getting a strange error when debugging a web app using oracle query notification and ODP.Net
The exception I'm getting is:
Item has already been added. Key in dictionary: '4118' Key being added: '4118'
The call stack is as follow:
Oracle.ManagedDataAccess.dll!OracleInternal.ServiceObjects.NotificationBufferManager.PutNotificationOraBufPool(OracleInternal.Network.OracleCommunication orclCommunication)
Oracle.ManagedDataAccess.dll!OracleInternal.ServiceObjects.NotificationHandler.ProcessBufferedNSDataPackets()
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state)
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart()
[Native to Managed Transition]
Does anyone have any idea what's causing this?
The Error is trying to tell you exactly whats wrong... a
Key
is being added to aDictionary
which already contains theKey
. There needs to be a check to see if a key exists first, then the value should be changed instead of trying to re add another value with the same key.