IBM Support

IC78314: DB2NMPCFG CAN CREATE DUPLICATE ENTRIES WITH SAME INVARIANT NAME IN DBPROVIDERFACTORIES SECTION OF MACHINE.CONFIG

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • db2nmpcfg.exe fails to remove entries with the same invariant
    name as the ones being added if the assembly version is
    different.  This results in an invalid machine.config since the
    invariant name must be unique. db2nmpcfg.exe should remove all
    DbProviderFactories entries with the same invariant regardless
    of other attribute values.
    
    An exception similar to the following is encountered when using
    DbProviderFactories with a mis-configured machine.config file:
    
               System.Configuration.ConfigurationErrorsException: An
    error occurred creating the configuration section handler for
    system.data: Column 'InvariantName' is constrained to be unique.
     Value 'IBM.Data.DB2' is already present.
    (c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.co
    nfig
    line 537) ---> System.Data.ConstraintException: Column
    'InvariantName' is constrained to be unique.  Value
    'IBM.Data.DB2' is already present.
       at System.Data.UniqueConstraint.CheckConstraint(DataRow row,
    DataRowAction action)
       at
    System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs
    args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
       at System.Data.DataTable.SetNewRecordWorker(DataRow row,
    Int32 proposedRecord, DataRowAction action, Boolean isInMerge,
    Int32 position, Boolean fireEvent, Exception& deferredException)
       at System.Data.DataTable.InsertRow(DataRow row, Int32
    proposedID, Int32 pos,Boolean fireEvent)
       at
    System.Data.Common.DbProviderFactoriesConfigurationHandler.DbPro
    viderDictionarySectionHandler.HandleAdd(XmlNode
    child, DataTable config)
       at
    System.Data.Common.DbProviderFactoriesConfigurationHandler.DbPro
    viderDictionarySectionHandler.CreateStatic(DataTable
    config, Object context, XmlNode section)
    ...
    

Local fix

  • Remove entries with duplicate invariant names from the
    <DbProviderFactories> section of the affected machine.config
    file.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * .NET applications on all supported versions of Microsoft     *
    * Windows Operating System                                     *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * db2nmpcfg.exe fails to remove entries with the same          *
    * invariant name as the ones being added if the assembly       *
    * version is different.  This results in an invalid            *
    * machine.config since the invariant name must be unique.      *
    * db2nmpcfg.exe should remove all DbProviderFactories entries  *
    * with the same invariant regardless of other attribute        *
    * values.                                                      *
    *                                                              *
    *                                                              *
    * An exception similar to the following is encountered when    *
    * using DbProviderFactories with a mis-configured              *
    * machine.config file:                                         *
    *                                                              *
    *                                                              *
    *           System.Configuration.ConfigurationErrorsException: *
    * An error occurred creating the configuration section handler *
    * for system.data: Column 'InvariantName' is constrained to be *
    * unique. Value 'IBM.Data.DB2' is already present.             *
    * (c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machin *
    * e.config line 537) ---> System.Data.ConstraintException:     *
    * Column 'InvariantName' is constrained to be unique.  Value   *
    * 'IBM.Data.DB2' is already present.                           *
    *                                                              *
    *   at System.Data.UniqueConstraint.CheckConstraint(DataRow    *
    * row, DataRowAction action)                                   *
    *                                                              *
    *   at                                                         *
    * System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArg *
    * s args, DataRow eRow, DataRowAction eAction, Boolean         *
    * fireEvent)                                                   *
    *   at System.Data.DataTable.SetNewRecordWorker(DataRow row,   *
    * Int32 proposedRecord, DataRowAction action, Boolean          *
    * isInMerge, Int32 position, Boolean fireEvent, Exception&     *
    * deferredException)                                           *
    *   at System.Data.DataTable.InsertRow(DataRow row, Int32      *
    * proposedID, Int32 pos,Boolean fireEvent)                     *
    *                                                              *
    *   at                                                         *
    * System.Data.Common.DbProviderFactoriesConfigurationHandler.D *
    * bProviderDictionarySectionHandler.HandleAdd(XmlNode child,   *
    * DataTable config)                                            *
    *   at                                                         *
    * System.Data.Common.DbProviderFactoriesConfigurationHandler.D *
    * bProviderDictionarySectionHandler.CreateStatic(DataTable     *
    * config, Object context, XmlNode section)                     *
    *                                                              *
    * ...                                                          *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Version 9.7 Fix Pack 5 or later.                  *
    ****************************************************************
    

Problem conclusion

  • Problem was first fixed in Version 9.7 Fix Pack 5.  This fix
    should be applied on the client.
    

Temporary fix

  • see LOCAL FIX.
    

Comments

APAR Information

  • APAR number

    IC78314

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-08-24

  • Closed date

    2011-12-19

  • Last modified date

    2011-12-19

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R910 PSN

       UP

  • R950 PSN

       UP

  • R970 PSN

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC78314

Modified date: 19 December 2011