tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <d...@cornell.edu>
Subject Re: Cannot create JDBC driver of class '' for connect URL 'null'"
Date Fri, 03 Nov 2006 22:19:43 GMT
I'll go further and say mysql discourages the use of autoReconnect.  See:

http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html

the section titled "High Availability and Clustering. "

--David

Christopher Schultz wrote:
> Eric,
>
> Eric Yin wrote:
>   
>> Hi,
>>
>> I'm using tomcat5.5.2 and mysql5.0.27 and Connector/J 5.0.
>> i'm doing the same thing as
>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
>> and i got this error.
>>     
>
> Where did you put mysql-connector-*.jar? I suspect that you have it in
> your webapp's lib directory, but you need to have it in Tomcat's
> server-wise common/lib directory.
>
> Another note:
>
>   
>> url="jdbc:mysql://localhost:3306/p6120?autoReconnect=true"/>
>>     
>
> Since you are using a DataSource which defaults to the Jakarta Commons
> DBCP pool, you should remove the "autoReconnect=true" from your URL;
> re-connection is handled by the DPCP library, so you /should be/ able to
> safely remove this parameter. This feature is documented to be
> undesirable as seen here:
>
> http://dev.mysql.com/doc/refman/4.1/en/connector-j-reference-configuration-properties.html
>
> For the lazy: (emphasis added by me)
>
> "Should the driver try to re-establish stale and/or dead connections? If
> enabled the driver will throw an exception for a queries issued on a
> stale or dead connection, which belong to the current transaction, but
> will attempt reconnect before the next query issued on the connection in
> a new transaction. *The use of this feature is not recommended, because
> it has side effects related to session state and data consistency when
> applications don'thandle SQLExceptions properly, and is only designed to
> be used when you are unable to configure your application to handle
> SQLExceptions resulting from dead andstale connections properly*.
> Alternatively, investigate setting the MySQL server variable
> "wait_timeout"to some high value rather than the default of 8 hours."
>
> -chris
>
>   


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


Mime
View raw message