You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/08/05 11:31:20 UTC
DO NOT REPLY [Bug 22126] New: -
MySQL Connector J - JDBC Realm needs two attempts to open new connection
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22126>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22126
MySQL Connector J - JDBC Realm needs two attempts to open new connection
Summary: MySQL Connector J - JDBC Realm needs two attempts to
open new connection
Product: Tomcat 4
Version: 4.1.24
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Unknown
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: danny@apache.org
Using MySQL connector-J instead of mm.mysql jdbc driver.
If the database "goes away" DBCP throws an exception (below) and fails to
authenticate, at the second attempt a new connection is established and
authentication succeeds.
I've noticed that Connector J exhibits at least two radically different
behaviours that the old mm.mysql driver, throwing this exception is one of them.
If the tomcat code calls Connection.isClosed() connector J doesn't ping the
server, mm.mysql did.
Exception performing authentication
java.sql.SQLException: Communication link failure: java.io.IOException
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1675)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1083)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1142)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1876)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1590)
at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1463)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)