You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kruse, Matt" <MK...@aquent.com> on 2003/06/09 19:03:31 UTC

Debugging Connection Pooling Problems? (dbcp, sybase)

Can anyone recommend a smart way to debug connection pooling issues? 

I'm using BasicDataSource, connecting to a Sybase11 server. It seems that
every night, all idle connections are closed by the server (no app
activity), but for some reason that's not detected by the connection pool.
Our app hangs while trying to get a connection, and I can't figure out why.
It doesn't even come back after the "maxWait" time and give me an exception
- it just waits forever.

I've logged the active and idle connection counts, and they are sitting at
like 1-3 each, so it's not approaching the limits of 20 active and 4 idle.

Here is my config inside of struts-config.xml:

<data-source key="TEST" type="org.apache.commons.dbcp.BasicDataSource">
 <set-property property="defaultAutoCommit" value="true"/>
 <set-property property="description" value="TEST"/>
 <set-property property="driverClassName"
value="com.sybase.jdbc.SybDriver"/>
 <set-property property="maxActive" value="20"/>
 <set-property property="maxWait" value="10000"/>
 <set-property property="maxIdle" value="4"/>
 <set-property property="minCount" value="2"/>
 <set-property property="validationQuery" value="SELECT 1"/>
 <set-property property="password" value="pass"/>
 <set-property property="url" value="jdbc:sybase:myserver:9996"/>
 <set-property property="username" value="user"/>
</data-source>

I've seen mention of the following items and I'm trying to learn more:

 - autoReconnect : Apparently set in the URL. Is this db-specific or
jdbc-specific?

 - removeAbandoned : Not quite sure what this does or if it would help,
given that I have a validationQuery?

 - testOnBorrow : Should this test the conn every time I get one? Isn't that
the point of the validationQuery?

Any ideas would be greatly appreciated. I'm trying to see "under the hood"
of the connection pooling, but not much is exposed for me to look at.

Matt Kruse

Re: Debugging Connection Pooling Problems? (dbcp, sybase)

Posted by Ted Husted <hu...@apache.org>.
Setting a "ping" command should help.

Kruse, Matt wrote:
> I'm using BasicDataSource, connecting to a Sybase11 server. It seems that
> every night, all idle connections are closed by the server (no app
> activity), but for some reason that's not detected by the connection pool.
> Our app hangs while trying to get a connection, and I can't figure out why.
> It doesn't even come back after the "maxWait" time and give me an exception
> - it just waits forever.





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