ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agcunha <agcu...@superig.com.br>
Subject Re: How to configure Ibatis to use two different IBatis mappers(not nHibernate) for two databases and using IBatis DAO?
Date Wed, 20 Jul 2005 18:49:59 GMT
I found the BUG. 

The problem is on DAO. It's on "DomDaoManagerBuilder.cs" file. 

Look at the function : private Provider ParseProvider(ConfigurationScope 
configurationScope) 

Line: XmlNode node = 
configurationScope.NodeContext.SelectSingleNode("//database/provider"); 

 This way, the DomDaoManagerBuilder sets the same provider (the first in 
file) for both contexts (InformixMapDao and SqlServerMapDao), although 
the dao.config file specifies two different providers. The datasource 
configuration is right,so, I changed "//database/provider" 
for "database/provider" (like the others Parse Mathods in this class). 

Do you know whether It will have any impact on others Ibatis functions? I 
think not... 
Should I register this bug on JIRA? 

Thanks, 
Anderson 


Em (18:44:05), user-cs@ibatis.apache.org escreveu: 


>Hello 
> 
>> 1º - I have to persist objets in TWO different databases (Informix and 
SQL 
>> Server) 
>> 2º - I have to use TWO IBatis Mappers (Informix and SqlServer) 
>> 3º - I have to use DaoManager to manage my DAO objects. 
>> ex: DaoManager.GetInstance("InformixMapDAO") and 
>> DaoManager.GetInstance("SqlServerMapDAO") 
> 
> May be such my code will help you: 
> 
>private static SqlMapper GetMapper(string sqlmapname) 
>{ 
>XmlDocument document = new XmlDocument(); 
>document.Load(sqlmapname); 
>return SqlMapper.Configure(document); 
>} 
> 
>This is body of the function that returns SqlMapper configured by file 
>that name is passed as parameter. Configuration file looks like: 
> 
><?xml version="1.0" encoding="UTF-8" ?> 
> 
>---------- 





Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message