Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 20771 invoked from network); 7 Feb 2011 14:29:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Feb 2011 14:29:55 -0000 Received: (qmail 47829 invoked by uid 500); 7 Feb 2011 14:29:55 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 47451 invoked by uid 500); 7 Feb 2011 14:29:52 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 47434 invoked by uid 99); 7 Feb 2011 14:29:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Feb 2011 14:29:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Feb 2011 14:29:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id AE34D196D29 for ; Mon, 7 Feb 2011 14:29:30 +0000 (UTC) Date: Mon, 7 Feb 2011 14:29:30 +0000 (UTC) From: "tangjie (JIRA)" To: issues@commons.apache.org Message-ID: <469441975.3890.1297088970710.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (DBCP-244) Connection socket hangs sporadically in DBCP 1.2.2 but not 1.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DBCP-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991391#comment-12991391 ] tangjie commented on DBCP-244: ------------------------------ pool-1-thread-247" prio=10 tid=0x00002aac48112000 nid=0x7155 runnable [0x000000005bf3b000] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at com.microsoft.sqlserver.jdbc.TDSChannel.read(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source) - locked <0x00002aab80b55d30> (a com.microsoft.sqlserver.jdbc.SQLServerConnection) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source) - locked <0x00002aab80b55e18> (a com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown Source) at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172) at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172) > Connection socket hangs sporadically in DBCP 1.2.2 but not 1.2.1 > ---------------------------------------------------------------- > > Key: DBCP-244 > URL: https://issues.apache.org/jira/browse/DBCP-244 > Project: Commons Dbcp > Issue Type: Bug > Affects Versions: 1.2.2 > Environment: Fedora Core 3, MySQL 4.1.22. with the latest driver (5.07). Exceptions only occur in the "job processing" JVM, which sits idle for long periods of time and occasionally wakes up to interact with the database. > Reporter: ori > Fix For: 1.3 > > > I think I've traced an exception to DBCP's code. > Communication with the database is hanging sporadically in a production environment. If I don't set the socketTimeout property on the underlying connection, it will hang forever. With the socketTimeout property, I get the following exception: > ------- > com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: > ** BEGIN NESTED EXCEPTION ** > java.net.SocketTimeoutException > MESSAGE: Read timed out > STACKTRACE: > java.net.SocketTimeoutException: Read timed out > at java.net.SocketInputStream.socketRead0(Native Method) > at java.net.SocketInputStream.read(SocketInputStream.java:129) > at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113) > at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160) > at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188) > at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1994) > at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2411) > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2916) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) > at com.mysql.jdbc.Connection.execSQL(Connection.java:3250) > at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1355) > at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1270) > at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228) > ... > ------- > It always happens in an infrequently used JVM (not an app server handling frequent connections). So it's likely the offending connection was asleep for a long time before the exception occurs. > I've confirmed that this issue only occurs using 1.2.2 and not 1.2.1. I've been looking through the changelogs but can't find anything that would cause this behavior. > Does somebody familiar with the codebase have any idea what change (1.2.1->1.2.2) could be causing this behavior? > Thanks -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira