You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ramon Garcia Alarcon <ra...@moixerosoftware.com> on 2011/01/27 08:46:47 UTC
Problems with connections pool in Tomcat 6.0.18 6.0.20 + MySQL 5.1 +
mysql-connector 5.1.x
Hi all,
I have a problem with:
Tomcat 6.0.x + MySQL 5.1 + mysql-connector.5.1.x
And I test with Ubuntu 10.04, Windows 2003 and Mac OSX 10.6.6
I configured the connection in tomcat like this:
<Resource driverClassName="com.mysql.jdbc.Driver"
logAbandoned="false"
maxActive="35"
maxIdle="2"
maxWait="5000"
name="jdbc/TheName"
password="password"
removeAbandoned="true"
removeAbandonedTimeout="60"
type="javax.sql.DataSource"
url="jdbc:mysql://localhost:3306/schema"
username="user"/>
In MySql I have good configured the wait_timeout and the interactive_timeout
in 28800.
The problem is that the pool never removes the connection and when the mysql
closes it, I got this exception:
java.sql.SQLException: Already closed
Some idea?
These configuration was worked properly in MySQL 4.1 and Tomcat 5.5..
Thanks!
Ramon Garcia
Re: Problems with connections pool in Tomcat 6.0.18 6.0.20 + MySQL
5.1 + mysql-connector 5.1.x
Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Add in validationQuery and testOnBorrow as seen below
<Resource driverClassName="com.mysql.jdbc.Driver"
logAbandoned="false"
maxActive="35"
maxIdle="2"
maxWait="5000"
name="jdbc/TheName"
password="password"
removeAbandoned="true"
removeAbandonedTimeout="60"
type="javax.sql.DataSource"
url="jdbc:mysql://localhost:3306/schema"
username="user"
testOnBorrow="true"
validationQuery="SELECT 1"/>
On 01/27/2011 12:46 AM, Ramon Garcia Alarcon wrote:
> Hi all,
>
> I have a problem with:
> Tomcat 6.0.x + MySQL 5.1 + mysql-connector.5.1.x
> And I test with Ubuntu 10.04, Windows 2003 and Mac OSX 10.6.6
>
> I configured the connection in tomcat like this:
>
> <Resource driverClassName="com.mysql.jdbc.Driver"
> logAbandoned="false"
> maxActive="35"
> maxIdle="2"
> maxWait="5000"
> name="jdbc/TheName"
> password="password"
> removeAbandoned="true"
> removeAbandonedTimeout="60"
> type="javax.sql.DataSource"
> url="jdbc:mysql://localhost:3306/schema"
> username="user"/>
>
> In MySql I have good configured the wait_timeout and the interactive_timeout
> in 28800.
>
> The problem is that the pool never removes the connection and when the mysql
> closes it, I got this exception:
> java.sql.SQLException: Already closed
>
> Some idea?
>
> These configuration was worked properly in MySQL 4.1 and Tomcat 5.5..
>
> Thanks!
>
> Ramon Garcia
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org