I am not 100% sure, but this seems like something I encountered while I was using the beta version. What I did was declare separate <daoSessionHandler> elements at the top of the config, each of whose implementation was IBatisNet.DataAccess.DaoSessionHandlers.SqlMapDaoSessionHandler. That way it doesn't reuse the same instance of the session handler for each context. Try using the attached config file instead of your current one (diff with yours to see what I changed).
 
If I remember right, you're correct that they're stored in a hashmap and they're clashing on the keys. One other thing, not sure if <daoSessionHandler's attribute should be "name" or "id" (I was attempting to take what I had from a project that used the beta). I used "name" in the attached config file. If it doesn't work try "id".
 
- Kit


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 08, 2005 3:11 AM
To: ibatis-user-cs@incubator.apache.org
Subject: Dao

Hi,

 

I am currently trying to reengineer my application. In fact, right now, this one is using patched IBATIS dll in order to be able to use several dao contexts with different daoSessionHandler. According to Gilles BAYON, the patch we have developped is due to our misunderstanding of the way we have to use IBATIS framework (see below the discussion with Gilles Bayon – sorry this is in french).

So because I am pretty sure he is right and we are not (I am not able to build up such a framework), I am trying to find out the correct way we have to follow in our application, but still I don’t manage to do so.

It is pretty important for us to follow the right IBATIS dlls because otherwise, we won’t be able to upgrade smoothly our application in parallel to ibatis.

 

So if anybody can help us, I would be very kind of him.

 

My problem is the following:

 

I get an error (with the right ibatis dlls) at the BaseSQLMapDao level. It is returning me a wrong SQLMap, because the line below:

 

SqlMapDaoSession sqlMapDaoSession = (SqlMapDaoSession)daoManager.LocalDaoSession; »

 

is always returning me the last SqlMapDaoTransaction defined in the configuration file (wimbv2Dao.config attachment file), so here the statisticsSqlMapDao …

I am wondering also why the daoSessionHandler have always the same name = SqlMap. Is it normal ? Maybe during the configuration loading, the objects are overwritten by each other in a hashmap or something like this because of the common key name (SQLMap)??

 

There is something I don’t understand certaintly, but where???

 

Best regards,

 

Jean-Guillaume LALANNE

 

 

Attachment: wimbv2Dao.config
Description: Binary data

Reply via email to