You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2006/12/12 15:28:22 UTC

Re: [OT] java.sql.SQLException: No more data to read from socket

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aiping,

[I marked this as off-topic because it looks like a JDBC issue and not a
Struts one.]

Aiping wrote:
> after a certain period, it starts to give
> java.sql.SQLException: No more data to read from socket and users of
> the website are not able to login. I restart the service, it
> performing fine and when left for a certain period again, it
> encountered the exception again.

How long does it take before your database is inaccessible? Is it a long
period of time, or only a few minutes? Are your database connections
idle when this happens? When you say that you restart the service, do
you mean that you restart your app server or the database?

If your database connections are timing out overnight (or some other
long interval), you might have a firewall between your app server and
the database. If that is the case, you'll have to configure your data
source to automatically re-establish database connections when they are
dropped.

The Oracle driver may know how to do this... I haven't used it in years.

Use of the struts data source configuration has been removed in the
latest versions, and is probably deprecated, anyway. I would recommend
moving your data source configuration to your app server (and out of
your struts configuration). This may also give you some more flexibility.

For instance, if you use Jakarta Tomcat as your app server, you will get
(by default) connections pooled using Jakarta Commons DBCP, which can be
configured to automatically reconnect when connections are dropped.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFfryF9CaO5/Lv0PARAkFVAJwL3xfsCZL0FDMei66LXjbxnB/GEwCdH+f5
onJfzkJJBxlMPO+C4Ra4OzY=
=xSfW
-----END PGP SIGNATURE-----

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