tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Turner <>
Subject Re: Setting up connection pools "on the fly"...
Date Fri, 20 Jan 2006 22:49:53 GMT
Maybe you don't even want a connection pool, rather a simple
non-pooling datasource.  If you generate a pool of connections for
each and every database, you may end up with a great many open
connections to your database server that hardly ever get used.  I
don't know too much about MySQL, but  in most other databases, each
connection has certain allocated resources, and the database typically
limits the max connections.  I have a similar situation, but I use a
simple datasource, and a servlet to create a new datasource for each
database on initialization based on a database entries. You can easily
create a datasource on the fly in a servlet.  I don't know if this is
the 'right' answer, but it works for me.


On 1/20/06, Warrick Wilson <> wrote:
> I've got a project where there's a basic interface, with some basic
> database access. However, when someone "signs up", then a new MySQL
> database will be allocated for them. There's security associated with
> it, and the user will have to log in to identify himself.
> How can I create a new connection pool for that new database for my
> web app? My current pool is set up in context.xml - do I modify that
> on the fly from my web app?
> What I'm doing currently is figuring out who the user is and which
> database he's associated with, and when I do any database work, the
> first statement is "USE <databasename>" to get the proper database.
> Is there a better approach? More like a proper approach? (Says he who
> isn't sure he fully understands connection pools yet....)
> --
> Warrick Wilson
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message