Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
DataAccess 1.6.1
-
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