tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Britton <jbritto...@gmail.com>
Subject Re: Tomcat5.5 MySQL14.12 java.net.SocketException: Broken pipe
Date Thu, 07 Oct 2010 04:57:48 GMT
To your mysql Resource definition below I would add
validationQuery="SELECT 1"

That should prevent your application from getting handed stale db
connections from your pool.  Take a look at the testOnBorrow and
validationQuery definitions here
http://commons.apache.org/dbcp/configuration.html

Jason



On Wed, Oct 6, 2010 at 8:18 PM, Steve Ryder <sryder@jsrsys.com> wrote:

> I am getting this during mysql connection (about once a week).
> I have read the thread on MySQL forum, which has a "solution", but the link
> to the solution is broken and points back to the same page.
> Suggestions have been use autoconnect=true
> Another was that the server timeout was shorter than the connection
> time-out.
> I have the following:
> In server.xml:
> <Connector port="80" maxHttpHeaderSize="8192"
>              maxThreads="192" minSpareThreads="32" maxSpareThreads="128"
>              enableLookups="false" redirectPort="8443" acceptCount="128"
>              connectionTimeout="20000" disableUploadTimeout="true" />
> In context.xml
> <Resource name="jdbc/MySql" auth="Container" type="javax.sql.DataSource"
>  url="jdbc:mysql://localhost.localdomain/rsa?autoReconnect=true"
>    factory="org.apache.commons.dbcp.BasicDataSourceFactory"
>  driverClassName="com.mysql.jdbc.Driver"
>  password="jsrsys" username="jsrsys"
>    maxWait="10000"   maxActive="200"  maxIdle="5"
>  removeAbandoned="true" removeAbandonedTimeout="300" logAbandoned="true"
> />
> Note that maxWait is 1/2 of connectionTimeout and I have
> autoReconnect=true.
> Any ideas.   This is low priority as users are able to reconnect by just
> pressing Refresh, but I would like this to go away.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message