commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Re: [DBCP] pool monitor/info/status API?
Date Wed, 16 Jun 2004 07:02:35 GMT

--- Dirk Verbeeck <> wrote:
> I assume you are using BasicDataSource on Tomcat.

Actually, I am using DBCP through Hibernate and inside of Jetty.  I am
not using it as a DataSource, but rather by loading a driver class,
etc., or at least I think that is what Hibernate is doing.

> You can simply lookup the datasource using JNDI like you alway do.
> Cast it to BasicDataSource and then use the available getters:
> ds.getNumActive(), ds.getNumIdle(), ds.getMaxActive(), ...

I think my environment (Hibernate) does not expose DBCP through its
API, so I don't think I can ask it to give me a reference to the
underlying DataSource or anything such.
So I am wondering whether DBCP offers some static hooks (i.e. methods)
that would allow me to look up my connection pool and then do something
like what you suggested above, in order to get the information about
the pool state?

In other words, is there any class/method that allows me to do this:
SomePoolClass pool = SomeDBCPClass.getPool();

Or something like that...

> Here is a page I use to debug JNDI configurations:
> This should get you started, feel free to update the Wiki if you find
> this usefull.

Thanks Dirk.


> wrote:
> > Hello,
> > 
> > I looked at the site and Javadocs and Wiki and glanced at the
> mailing
> > list archives, but did not see what I was looking for, which is:
> > 
> > Is there a way to peek into a DBCP-managed connection pool in order
> to
> > get some information about the status of the pool?
> > (e.g. current pool size, max pool size, etc.)
> > 
> > Is this the DBCP entry point that I am looking for:
> >
> > 
> > Thank you,
> > Otis
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message