tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: OT: db pool problems - jdbc connection count?
Date Thu, 30 Oct 2003 19:30:15 GMT

Howdy,
You can write a bit of code to do this:

- Create an InitialContext
- Get the java:comp/env context
- Lookup your connection pool by JNDI name
- Cast your connection pool to the appropriate type as specified in your
server.xml

Then you can call the implementation-specific method, e.g.
getNumActive() / getNumIdle() for
org.apache.commons.dbcp.BasicDataSource, to look at values.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Oscar Carrillo [mailto:tomcat@daydream.stanford.edu]
>Sent: Thursday, October 30, 2003 1:18 PM
>To: Tomcat Users List
>Subject: Re: OT: db pool problems - jdbc connection count?
>
>How about just watching the processes for postgresql while you access
the
>site?:
>
>ps auxw | grep "postgres"
>
>Oscar
>
>On Thu, 30 Oct 2003, john-paul delaney wrote:
>
>> Hello List...
>>
>> Sorry if this is off-topic.  Although I think I'm following the
>> jndi-resources-howto fairly well, I find I'm running out of
connections
>> and I have to restart tomcat to free them up.  I'd like to know how
many
>> jdbc connections are in use at any given time with the intention of
>> finding the offending servlet(s).  I'm using postgreSQL.  I've
googled
>> and looked at the postgres user lists but not found an example on how
to
>> detect the current number of connections in use.  Can anyone help?
>>
>> tomcat 4.1.24
>> postgresql 7.3.3
>> pg73jdbc3.jar
>> commons-pool 1.0.1
>>
>> I believe I'be been pretty thorough in closing down resultsets,
>preparedstatements and connections after use, and use the
removeAbandoned
>parameter in the DataSource Resource section of server.xml.
>>
>> Any leads are much appreciated.
>>
>> thanks
>> /j-p.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message