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