You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Martin Kalén <mk...@apache.org> on 2005/06/01 19:11:51 UTC
Re: Deep down
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
RE: Deep down
Posted by Nils Liebelt <ni...@candor.co.za>.
Thanks,
I think Fastrack will do for now. :-)
mtgglf
Nils
-----Original Message-----
From: Martin Kalén [mailto:mkalen@apache.org]
Sent: Wednesday, June 01, 2005 7:12 PM
To: OJB Users List
Subject: Re: Deep down
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
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org