commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Waldhoff, Rodney" <>
Subject RE: DBCP PoolingDataSource
Date Wed, 16 Jan 2002 17:43:45 GMT
Yeah. Something like this I think:

* Have PoolingDataSource and PoolingDriver contain a KeyedObjectPool rather
than simply an ObjectPool, using the (possibly null?) uname/passwd pair as
the key.

* Make PoolableConnectionFactory implement KeyedPoolableObjectFactory rather
than simply PooledObjectFactory (as you mention, you could extend
BaseKeyedPoolableObjectFactory to do this)

* add a createConnection(uname,passwd) to the ConnectionFactory interface
(perhaps also createConnection(Properties) or whatever other factory methods
make sense), and implement it for the relevant children

So that PoolingDataSource.getConnection(uname,passwd) can invoke
pool.borrowObject(new Pair(uname,passwd)), which in turn will invoke

I suspect there are a few other issues lurking about (PoolableConnection
will have to change to make sure it returns itself to the right keyed-pool,
etc.), and glancing over it it's a little more complicated than I remembered
it, but I think that's basically it.

-----Original Message-----
From: Randy Speh []
Sent: Wednesday, January 16, 2002 10:30 AM
To: Jakarta Commons Developers List
Subject: RE: DBCP PoolingDataSource

So it looks like I need to extend and implement 

Does that seem correct?

Randy Speh
--- "Waldhoff, Rodney" <>
> > Are there plans to make the PoolingDataSource
> support
> > the getConnection(user, pwd) method?
> It's a little bit tricky since it's the
> ObjectPool/ConnectionFactory that
> actually creates the Connections, so there's
> currently no direct way for the
> PoolingDataSource to pass the arguments down to the
> DataSourceConnectionFactory.  One way to do it would
> be to use a
> KeyedObjectPool instead of ObjectPool, and pass the
> username/password pair
> (or in the case of the PoolingDriver, the Properties
> object) as the key.
> I might play around with that if I get a chance, but
> it'll probably be a few
> days before I do, so don't let that stop you if
> you've got an itch for it.
> - Rod
> > Thanks,
> > Randy Speh

Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message