Uploaded image for project: 'iBatis for .NET'
  1. iBatis for .NET
  2. IBATISNET-94

DomDaoManagerBuilder cannot set more than one provider element when defining more than one SqlMaps and databases in DAO.config

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • DataAccess 1.6.1
    • DataMapper 1.3
    • None
    • None
    • Windows Xp, .NET Framework 1.1

    Description

      DomDaoManagerBuilder cannot set more than one provider element when defining more than one SqlMaps and databases in DAO.config

      For example:

      <context id="InformixMapDao">

      <properties resource="../../database.config"/>

      <database>
      <provider name="Informix"/>
      <dataSource name="iBatisNet" connectionString="User Id=${Ifxuserid};Database=${Ifxdatabase};Host=${Ifxhost};password=${Ifxpassword};Server=${Ifxserver};Protocol=${Ifxprotocol}; Service==${Ifxservice};"/>
      </database>

      <daoSessionHandler id="SqlMap">
      <property name="url" value="D:\PROJETOS\SIGA\CookBooks\Persistencia\ONSA\Ons.Onsa.Persistence.Tests\bin\Debug\SqlMapInformix.config"/>
      </daoSessionHandler>

      <daoFactory>
      <dao interface="Siga.Persistencia.Interfaces.Forum.IMembroDao, Siga.Persistencia" implementation="Siga.Persistencia.MapperDao.Forum.MembroSqlMapDao, Siga.Persistencia"/>
      </daoFactory>

      </context>

      <context id="SqlServerMapDao">

      <properties resource="../../database.config"/>
      <database>
      <provider name="sqlServer1.1"/>
      <dataSource name="iBatisNet" connectionString="data source=${MSSQLdatasource};database=${MSSQLdatabase};user id=${MSSQLuserid};password=${MSSQLpassword};connection reset=false;connection lifetime=5; min pool size=1; max pool size=50"/>
      </database>

      <daoSessionHandler id="SqlMap">
      <property name="url" value="D:\PROJETOS\SIGA\CookBooks\Persistencia\ONSA\Ons.Onsa.Persistence.Tests\bin\Debug\SqlMapMSSQL.config"/>
      </daoSessionHandler>

      <daoFactory>
      <dao interface="Siga.Persistencia.Interfaces.Forum.IMembroDao, Siga.Persistencia" implementation="Siga.Persistencia.MapperDao.Forum.MembroSqlMapDao, Siga.Persistencia"/>
      </daoFactory>

      </context>

      It happens because of the method (on DomDaoManagerBuilder.cs file):
      private Provider ParseProvider(ConfigurationScope configurationScope).

      I changed the line XmlNode node = configurationScope.NodeContext.SelectSingleNode("//database/provider");
      TO: configurationScope.NodeContext.SelectSingleNode("database/provider");

      Like the other Parsers methos in this class... It will correct the bug.

      Thanks,
      Anderson

      Attachments

        Activity

          People

            gilles Gilles Bayon
            agcunha Anderson Gomes
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: