You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Patricio Keilty <pk...@miracleconsulting.com> on 2003/05/19 18:44:00 UTC

DBCP validation query problem

Hi,
we're using Tomcat connection pooling and have set the validationQuery
parameter so it can detect stale-idle connections to the DB server. When
the DB server goes down, the pool won't recycle connections, we keep on
receiving a SQLException: Broken pipe. Also, we're using a profiler tool
for our DB server ( MS SQL Server) and it won't show the validation
query executed when we get a connection from the pool.

( Below is an excerpt from server.xml defining the Datasource.)

Removing BasicDataSourceFactory factory parameter seems to make it work
though don't know if tomcat connection pooling is still involved (?).
This time the profiler is showing "SELECT 1" queries whenever we get a
connection from the pool.

What maybe the problem? Is tomcat using a default factory to create
Datasources in case no factory parameter is specified?

Any help would be appreciated, thanks.

Patricio.

P.S:

Our datasource definition in server.xml:

<ResourceParams name="jdbc/fwic">
<parameter>
    <name>validationQuery</name>
    <value>SELECT 1</value>
</parameter>
<parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
    <name>url</name>
   
<value>jdbc:microsoft:sqlserver://192.168.0.72:1433;DatabaseName=jfwicdemo</value>
</parameter>
<parameter>
    <name>password</name>
    <value></value>
</parameter>
<parameter>
     <name>maxActive</name>
     <value>6</value>
</parameter>
<parameter>
     <name>maxWait</name>
     <value>5000</value>
</parameter>
<parameter>
     <name>driverClassName</name>
     <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</parameter>
<parameter>
     <name>username</name>
     <value>sa</value>
</parameter>
<parameter>
     <name>maxIdle</name>
     <value>2</value>
</parameter>
</ResourceParams>

we're currently using: TOMCAT 4.1.18, Sun JVM 1.3.1_06, MS SQL Server
2000 + Microsoft JDBC Type 4 Driver.


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