1

We are getting following exception while using oracle UDT:

ArgumentException: Item has already been added. Key in dictionary:....

at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at Oracle.DataAccess.Types.OracleUdt.GetAllReferencedAssemblies() at Oracle.DataAccess.Client.RegAndConfigRdr.setudtmapping(Hashtable& s_mapUdtNameToMappingObj) at Oracle.DataAccess.Types.OracleUdt.SetCustomTypeMappings() at Oracle.DataAccess.Types.OracleUdt.GetUdtName(String customTypeName, String dataSource) at Oracle.DataAccess.Client.OracleParameter.SetUDTFromCustomObject(OracleConnection conn, IOracleCustomType customObj, Int32 i) at Oracle.DataAccess.Client.OracleParameter.PreBind_Collection(OracleConnection conn) at Oracle.DataAccess.Client.OracleParameter.PreBind(OracleConnection conn, IntPtr errCtx, Int32 arraySize, Boolean bIsFromEF, Boolean bIsSelectStmt) at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.DataAccess.Client.OracleCommand.ExecuteReader() at DBConn.DB_Command.ExecuteReader()

Happens only on the production machine. Not reproducible in local developer environment. Does anyone know what's going on?

  • of course, you cut down the part of error that tells you what is wrong. You having a duplicate data. Nothing **we** can do about it – T.S. Aug 06 '20 at 20:00
  • This is the only exception that i have got. We cut nothing – Yaroslav Brichko Aug 17 '20 at 20:55
  • again, read the message. your program attempting to add the key, which already exists here `Hashtable.Insert`. Which basically can mean that in your production data you have some dups – T.S. Aug 17 '20 at 21:21
  • I'm so sorry. Did you read the exception? Did you see who call HashTable.Insert? The only thing my program does - call to common ExecuteReader(). – Yaroslav Brichko Aug 18 '20 at 09:16
  • 1
    I am very grateful that you are trying to help me, but unfortunately you are wrong. This is how oracle does the mapping between UDTs and their C # representation; the code works fine with any type of application except Web.API. Solution we temporarily found by putting udt mapping in Web.config. Thanks – Yaroslav Brichko Aug 18 '20 at 09:33

0 Answers0