ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agcunha <agcu...@superig.com.br>
Subject How to configure Ibatis to use two different IBatis mappers(not nHibernate) for two databases and using IBatis DAO?
Date Tue, 19 Jul 2005 20:51:48 GMT

Hello, 

        It's very important... Please, help! 

	I sent two questions before and now I'll be more clear: 
I need to configure IBatis to support Two Databases in my application in 
this way: 

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") 

In Dao NUnit tests, most of time I could find TWO Contexts with TWO 
SessionHandles, one for NHibernate and one for Ibatis Mapper. 
I have to use just the IBatis Mapper, so, I wrote the dao.config in this 
way: 

	http://www.agcsolucoes.com/dao.config.txt 

If I test this file using either Informix context or SqlServer Context it's 
ALL RIGHT, but, when I try to test using two contexts at the same time, 
the follow error occurs: 

IBatisNet.DataAccess.Exceptions.DataAccessException : Unable to intercept 
method name GetMembro 
  ----> System.ArgumentException : Invalid argument 

 This is the code: 

 	MembroBO member = new MembroBO(); 
	MembroDao = _daoManager[typeof(IMembroDao)] as IMembroDao; 
	// MembroDao == 
[ProxyInterfaceMembroSqlMapDao_IMembroDao_IDao_ISerializable] 
{ProxyInterfaceMembroSqlMapDao_IMembroDao_IDao_ISerializable}	ProxyInterfaceMembroSqlMapDao_IMembroDao_IDao_ISerializable

	member = MembroDao.GetMembro(2); // Error : Unable to intercept method name 
GetMembro 

The interfaces and implementation of my classes are Okay and If I had any 
problem the Unit test would show. 
Is it a bug in Castle Proxy? Is it an IBatis limitation? 
Have anybody ever used this case? 

Thanks, 
Anderson 





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