ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Voorhoeve, Niels {PBG}" <niels.voorho...@pepsi.com>
Subject Same table, multiple sources
Date Fri, 04 Nov 2005 20:38:21 GMT
Hi,

I have a situation where I need to read the same table from a couple of
different servers.  I'm using the ibatis dao framework on top of ibatis
sqlmaps.  I've thought of a couple of solutions and was wondering what the
best practice is?

1.  
	a. Copy the sqlmap config file for the table to a new name.
	b. Create another Dao class and context to use the new file.

2.
	a. Create a second instance of a DaoManager from a second
dao-config.xml which reuses the same dao class and table.


It would be nice if the daoManager had a feature to specify the context to
use so that the above wouldn't be necessary.  Would it be feasible to add
such a feature?  

I guess it would look something like:
	dao-config.xml:
		<context name="this.server">
		...
		<context name="that.server">
	
	daoManager.getDao(SomeBean.class, "this.server");

Thanks,
Niels

Mime
View raw message