ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lamey <cla...@localmatters.com>
Subject AbstractRoutingDataSource & cache
Date Fri, 06 Apr 2007 16:03:15 GMT
Hello all,

I'm looking at using Spring's new-ish AbstractRoutingDataSource to hit
multiple DataSources with iBATIS.  I think it'll work fine in terms of
routing to the right DataSource via a ThreadLocal, but I'm concerned
about the iBATIS caching mechanism.

Specifically, it seems to me that if I have a single
SqlMapClientFactoryBean with RoutingDataSource as the DataSource, the
cache in the SqlMapClient won't know which 'real' DataSource the results
came from and mix them all together.  So if the databases in question
have the same schemas and some overlapping OIDs, the cache would be
messed up.

Does that sound about right?  Is there a way to avoid that other than
not using cache?  Is there a better way to use Spring and iBATIS with
multiple DataSources?

Thanks,
Chris

Mime
View raw message