Drop the ?autoReconnect=true from your mysql url and then add validationQuery="select 1" testOnBorrow="true". I believe the testOnBorrow is true by default, but their's no harm in setting it explicitly.
<Resource   name="jdbc/mysql_gaeaglobalvrmanager"
           auth="Container"
           type="javax.sql.DataSource"
           driverClassName="com.mysql.jdbc.Driver"
           maxIdle="15"
           maxWait="10000"
           username="root"
           url="jdbc:mysql://localhost:3306/mscore"
           validationQuery="select 1"
           testOnBorrow="true"
           maxActive="2000"
           removeAbandoned="true"
           removeAbandonedTimeout="60"/>


Autoreconnect doesn't do what you'd assume it should. It will not automatically reconnect and then retry the query. Instead it will throw a SQLException and then connect so you can try the query again.

--David

Sury Balasubramanian wrote:
Hello all,
I run tomcat connecting to two separate instances (one mySQL instance)
running on the same machine and the other one is oracle.

If i leave tomcat idle overnight and come back the next day, it doesn't
reconnect to mySQL even though i have the following in the JNDI settings..



<Resource   name="jdbc/mysql_gaeaglobalvrmanager"
            auth="Container"
            type="javax.sql.DataSource"
            driverClassName="com.mysql.jdbc.Driver"
            maxIdle="15"
            maxWait="10000"
            username="root"
            url="jdbc:mysql://localhost:3306/mscore?autoReconnect=true"
            maxActive="2000"
            removeAbandoned="true"
            removeAbandonedTimeout="60"/>

I dont have the reconnect option at all for oracle and the connection works
fine.

Is this a question to be posed to a mySQL forum. apologize if this is out of
place?

Thanks

Sury



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to