Problem validating connections from connection pool

This is a discussion on Problem validating connections from connection pool within the MySQL Database forums, part of the Database Forums category; I'm using MySQL on a Tomcat server with the DBCP connection pool. I'm having trouble setting up the ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-18-2007
flarosa
 
Posts: n/a
Default Problem validating connections from connection pool

I'm using MySQL on a Tomcat server with the DBCP connection pool.

I'm having trouble setting up the connection pool such that it will
validate connections. I initialized the connection pool object in an
xml file like this -

<bean id="my-datasource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-
method="close">
<property name="driverClassName"
value="com.mysql.jdbc.Driver" />
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="initialSize" value="4"/>
<property name="maxActive" value="400"/>
<property name="maxIdle" value="40"/>
<property name="poolPreparedStatements" value="true"/>
<property name="validationQuery" value="select 1"/>
<property name="testOnBorrow" value="true"/>
</bean>

To test it, I start Tomcat and run a few queries. Then I stop and
restart my MySQL server, then I try to run the queries again. What I'm
expecting to happen is that the connection pool will realize that the
old connections don't work again and discard them before they're ever
returned to my application. Instead, my application gets the bad
connections and errors out trying to use them. This happens
indefinitely until I restart Tomcat.

I also tried using a query that actually queries a real table in my
database, but that did not help.

Is there something wrong with my configuration? This seems like a
pretty simple and straightforward thing that should work with no fuss.

Thanks,
Frank

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:35 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0