You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Howard Miller <h....@admin.gla.ac.uk> on 2002/08/15 12:46:36 UTC
Connection pool question
Hi,
Newbie, JDBC connection pool question:
My application uses a central control database. This is ok, and I can see
how to use a connection pool for my application to access this.
BUT... The application allows a user to recover data from a range of
additional databases. That is the central database verified logins etc and
then lists a number of databases for the user to connect to.
I am very unsure how to handle this "sub -connection". I have a number of
thoughts... all bad:
1. Set up connection pools to ALL possible databases (there are less than
10), at the start in the application scope.
2. Set up a dedicated connection in the session scope.
3. Set up a dedicated connection in the request scope (cgi style).
I don't like any of these answers. Anybody have experience of this sort of
"dynamic database connection" or have any thoughts.
Regards,
RE: Connection pool question
Posted by Robert Taylor <rt...@mulework.com>.
One solution might be to define several datasources in your
application/servlet container where each datasource corresponds to its
respective database.
Then use JNDI to access the datasources from your application.
robert
> -----Original Message-----
> From: Howard Miller [mailto:h.miller@admin.gla.ac.uk]
> Sent: Thursday, August 15, 2002 6:47 AM
> To: 'struts-user@jakarta.apache.org'
> Subject: Connection pool question
>
> Hi,
>
> Newbie, JDBC connection pool question:
>
> My application uses a central control database. This is ok, and I can see
> how to use a connection pool for my application to access this.
>
> BUT... The application allows a user to recover data from a range of
> additional databases. That is the central database verified logins etc and
> then lists a number of databases for the user to connect to.
>
> I am very unsure how to handle this "sub -connection". I have a number of
> thoughts... all bad:
> 1. Set up connection pools to ALL possible databases (there are less than
> 10), at the start in the application scope.
> 2. Set up a dedicated connection in the session scope.
> 3. Set up a dedicated connection in the request scope (cgi style).
>
> I don't like any of these answers. Anybody have experience of this sort of
> "dynamic database connection" or have any thoughts.
>
> Regards, << File: ATT00047.txt >>