Uhm, that is already available. ;-)

public Dao getDao(Class iface, String contextId);

<context id="foo">...</context>
<context id="bar">...</context>

Larry


On 11/4/05, Voorhoeve, Niels {PBG} <[EMAIL PROTECTED]> wrote:
> 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
>

Reply via email to