You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Kris Rasmussen <kr...@yahoo.com> on 2006/03/16 05:01:30 UTC

dealing with multiple databases?

Hi,
 
I am about to deploy a massive web application which uses ibatis. My database is designed to be partioned into separate clusters for maximum scalability so I will eventually need a way to dynamically set the datasource ibatis is using on a per request basis based on a ClusterId.
 
Right now ibatis does not seem to provide any mechanism for swapping datasources/managing multiple datasources in the same sqlmap. I was curious if anyone has attempted this, or if anyone has any suggestions before I get started hacking away. I suspect I will have to create my own DataSource implementation but I was curious if anyone has already done something similar?
 
Thanks,
Kris

Re: dealing with multiple databases?

Posted by Larry Meadors <lm...@apache.org>.
I have heard of a few databases that have this in their data source
implementations, but suspect that you will need to "roll yer own"
DataSource and DataSourceFactory (an iBATIS specific class).

Sounds like a fun one, though! :-)

Larry


On 3/15/06, Kris Rasmussen <kr...@yahoo.com> wrote:
>
> Hi,
>
> I am about to deploy a massive web application which uses ibatis. My
> database is designed to be partioned into separate clusters for maximum
> scalability so I will eventually need a way to dynamically set the
> datasource ibatis is using on a per request basis based on a ClusterId.
>
> Right now ibatis does not seem to provide any mechanism for swapping
> datasources/managing multiple datasources in the same sqlmap. I was curious
> if anyone has attempted this, or if anyone has any suggestions before I get
> started hacking away. I suspect I will have to create my own DataSource
> implementation but I was curious if anyone has already done something
> similar?
>
> Thanks,
> Kris