Periodic "Broken Pipe"s from mysql

I have been getting odd disconnections when using a remote mysql DB for openfire’s database. This same installation USED to have the DB on the same machine, but it was moved off for other reasons.

Now, the case seems to be as follows:

  • If there are 0 connections for a period of time, the next attempt will fail with a 401 “not-authorized” stanza

  • If at least one connection is open, it appears to work fine.

The exceptions range from “Broken Pipe” to “EOF Error” to “Communications link failure”.

According to MYSQL’s docs, this can happen with older JDBC versions, but using the latest Connector/J changes nothing.

Changing timeouts on the server likewise does nothing.

I can connect fine using the command line client from this box to the server.

I don’t know where to look now, so any help would be appreciated.

EDIT: This affects the admin console as well, if that makes it clearer

To be clear - this happens on two different machines running openfire - one hitting the DB over the local network, one across the internet, so it shouldn’t be a networking issue