ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lamey <cla...@localmatters.com>
Subject Re: How can I change datasource connect info on the fly w/iBATIS and Spring?
Date Tue, 17 Apr 2007 18:40:14 GMT
That should work ok, that Map could get modified at servlet init time.

On Tue, 2007-04-17 at 11:27 -0700, Paul Sanders wrote:
> Hmm... I wonder if it would be possible to update the datasource mapping
> later? Its true that I don't know the datasources at init time but I do know
> them as soon as the first servlet class is loaded. Can the targetDataSource
> Map get updated after the AbstractRoutingDataSource has been created?
> 
> Paul
> 
> Chris Lamey wrote:
> > 
> > Yea, Spring has a new AbstractRoutingDataSource that can route to a
> > different datasource based on a ThreadLocal.  The problem is that the
> > iBATIS SqlMapClient doesn't know the datasource isn't the same between
> > calls, so your caching gets horked.
> > 
> > I don't know if it'll work for you because your datasources have to be
> > known in advance and it sounds like yours may not be.
> > 
> > Cheers,
> > Chris
> > 
> 
> 

Mime
View raw message