Skip navigation links

MySQL Forums :: Connector/JDBC and Java :: MySQL java.net.SocketException: Broken pipe


Advanced Search

Re: MySQL java.net.SocketException: Broken pipe
Posted by: Mark Matthews ()
Date: September 04, 2005 09:40PM

Leo Chan wrote:
> Hi,
>
> I have a MySQL server and client running at the
> same server. However, when running long times
> ~few hrs, it will come out some Exception as
[snip]
> This kind of error came out in random. As I
> run the client and server at same host(localhost
> in driver setting) so it should not have network
> problem cause broken pipe. The MySQL version I

Leo,

Whether or not the server is remote or local has little to do with whether TCP/IP connections can have network problems.

The problem you're experiencing is because you've configured your connection pool to let connections remain in an idle state for longer than what the server will allow. The server reclaims connections that have been idle for quite some time, as it is a waste of resources. There's not a lot of situations where it makes sense to let connections sit idle for _hours_.

> use is 4.1.8 and JDBC Driver is 3.1.10. The
> socketTimeout of the driver has been set to"0". I
> use connection pool so that every connection is
> reused but not "new" on demand.
>
> Please help to advise what's wrong.

The fix for this is covered in the documentation:

http://dev.mysql.com/doc/mysql/en/cj-faq.html

For an example of a way of configuring a connection pool to not allow long idle times, see:

http://dev.mysql.com/doc/mysql/en/cj-tomcat-config.html

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject Written By Posted
MySQL java.net.SocketException: Broken pipe Leo Chan 09/04/2005 07:54PM
Re: MySQL java.net.SocketException: Broken pipe Mark Matthews 09/04/2005 09:40PM
Re: MySQL java.net.SocketException: Broken pipe Leo Chan 09/05/2005 01:50AM
Re: MySQL java.net.SocketException: Broken pipe Simon Haldon 02/23/2006 10:48AM
Re: MySQL java.net.SocketException: Broken pipe Mark Matthews 02/23/2006 10:52AM
Re: MySQL java.net.SocketException: Broken pipe Simon Haldon 02/23/2006 10:57AM
Re: MySQL java.net.SocketException: Broken pipe vzelenko 03/02/2006 09:17AM
Re: MySQL java.net.SocketException: Broken pipe Anderson Meirelles 03/08/2006 07:41AM
Re: MySQL java.net.SocketException: Broken pipe Mark Matthews 03/08/2006 07:48AM
Re: MySQL java.net.SocketException: Broken pipe Anderson Meirelles Freitas 03/08/2006 08:37AM
Re: MySQL java.net.SocketException: Broken pipe Mark Matthews 03/08/2006 08:43AM
Re: MySQL java.net.SocketException: Broken pipe YoungSun Kim 04/30/2006 11:18PM
Re: MySQL java.net.SocketException: Broken pipe Tae Yeon Jeon 06/15/2006 01:39AM
Re: MySQL java.net.SocketException: Broken pipe lv qi 07/18/2006 08:18PM
Re: MySQL java.net.SocketException: Broken pipe Allwyn Hill 04/18/2006 01:20PM
Re: MySQL java.net.SocketException: Broken pipe Anson Parker 04/22/2006 07:19PM
Re: MySQL java.net.SocketException: Broken pipe Martin Malo 05/09/2006 01:40PM
Re: MySQL java.net.SocketException: Broken pipe Karikalan Kumaresan 10/05/2006 11:33PM
Re: MySQL java.net.SocketException: Broken pipe Mark Matthews 10/06/2006 11:45AM
Re: MySQL java.net.SocketException: Broken pipe Dmitry Kobyleha 06/16/2008 04:30AM
Re: MySQL java.net.SocketException: Broken pipe shivam shah 02/28/2006 12:46AM
Re: MySQL java.net.SocketException: Broken pipe Steve Reber 09/22/2006 08:05AM
Re: MySQL java.net.SocketException: Broken pipe Lavanya Rathnakumar 06/19/2009 06:45AM
Re: MySQL java.net.SocketException: Broken pipe Jeyendran Balakrishnan 08/31/2009 06:33PM
Re: MySQL java.net.SocketException: Broken pipe suda Murali 11/29/2009 10:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.