db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kalén <mka...@apache.org>
Subject Re: Deep down
Date Wed, 01 Jun 2005 17:11:51 GMT
Nils Liebelt wrote:
> I get a wired Exception thrown by a OJB application seems like something
> deep out of the MySQL JDBC. 
<snip/>
> The error only occures when the system
> isn't answering any request for a while.
<snip/>
> java.sql.SQLException: Communication link failure: java.io.EOFException,

You are probably missing a validation query to check if the pooled Connection
objects have a live communication link to the database.

If 'something' makes the link drop (eg MySQL drops the connection due to
inactivity timeout - Oracle RDMBS does this, but I'm not sure if MySQL can
be configured in a similar fashion, or the network connectivity has gone
down and up again) the Connection object that OJB checks out from the pool
will have no TCP/IP connection to your database and you will get this
"communication link failure".

This is a problem/feature of any JDBC connection pool, so the answer apply
to applications other than OJB as well.

Fast-track answer:
  Change your connection-pool settings in repository_database.xml and
  make sure to include testOnBorrow="true" and validataionQuery="SELECT 1".

See here for a recent longer discussion regarding this:
  http://www.mail-archive.com/ojb-user@db.apache.org/msg13521.html

Regards,
  Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message