Frequent database connection problems with a remote mysql database

I’'m using wildfire 2.6.2 on debian

when I use a local myqsl database everything works fine.

when I use a remote mysql database it works 50% of the time

I’‘ve verified that i’'m not exceeding mysql max users…

Here is my stact trace when it breaks, any help would be appreciated… I’'m using triggers to synch my users with another app, so I really need to use the remote mysql database.

any help is super appreciated!

Exception:

com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

  • BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException

at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1905)

at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2351)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2917)

at com.mysql.jdbc.Statement.executeQuery(Statement.java:824)

at com.mysql.jdbc.DatabaseMetaData.getUserName(DatabaseMetaData.java:5982)

at org.jivesoftware.wildfire.admin.server_002ddb_jsp._jspService(server_002ddb_jsp .java:106)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:830)

at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:11 8)

at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:43)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingF ilter.java:41)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:98)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler. java:471)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)

at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.ja va:633)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)

at org.mortbay.http.HttpServer.service(HttpServer.java:909)

at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)

at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)

at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)

at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)

at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)

at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

  • END NESTED EXCEPTION **

Last packet sent to the server was 7 ms ago.

at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2563)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2917)

at com.mysql.jdbc.Statement.executeQuery(Statement.java:824)

at com.mysql.jdbc.DatabaseMetaData.getUserName(DatabaseMetaData.java:5982)

at org.jivesoftware.wildfire.admin.server_002ddb_jsp._jspService(server_002ddb_jsp .java:106)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:830)

at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:11 8)

at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:43)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingF ilter.java:41)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:98)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler. java:471)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)

at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.ja va:633)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)

at org.mortbay.http.HttpServer.service(HttpServer.java:909)

at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)

at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)

at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)

at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)

at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)

at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

Hi,

I wonder if you want to patch your MySQL 3.1.12 driver as described in:

http://bugs.mysql.com/bug.php?id=14938 and http://lists.mysql.com/commits/1884

Maybe the 5.0.0-beta driver solves this problem.

Both options should be tested on a test server and not in production.

LG

I’‘d try it, but i’‘ve searched my machine for the file to patch (CharsetMapping.java) and it’'s not there.

I’'m using the binary distribution, perhaps I need the source or jar distribution to see it?

Thanks,

-Eric

Hi Eric,

If you copy the setProperty mappings from his checkin log to your source copy of the CharsetMapping.java and rebuild the connector jar using the build.xml and use the newly built jar it works just fine.” sounds for me like some work and not like a ready patch.

LG

Some changes on the mysql forum really helped:

http://forums.mysql.com/read.php?39,16257,90746#msg-90746

suggests changing my.cnf

wait_timeout=500

and ?autoReconnect=true to the JDBC driver url

Now I’'m only having an issue about 1% of the time, much better than 50%

Thanks,

-Eric