"Wes Clark" wrote:
> The stack trace is
>
> Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
> at
> com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown
> Source)
> at com.microsoft.sqlserver.jdbc.TDSWriter.flush(Unknown Source)
> at com.microsoft.sqlserver.jdbc.TDSWriter.endRequest(Unknown Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.executeStatement(Unknown Source)
> at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
> at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown
> Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown
> Source)
>
> This is happening during a performance stress test, and only happens very
> sporadically: two or three times during a multi-hour test of several
> simultaneous users pounding on the database. There are no events on the DB
> server, and nothing in the SQL Server 2005 log. The Tomcat server is running
> on Linux. We are using a commons-DBCP connection pool that validates the
> connection on borrow with "select 1", so we know the connection is good when
> we get it for the pool. The network error happens right after a prepare
> statement, so the connection is working, and then breaks on the execute of
> the prepared statement. The query is not a long running query. We've also
> checked the network health and it looks fine. We start some background batch
> jobs against the server before the errors start to occur.
>
> We are pretty much out of ideas. There are some relevant threads we can see
> by Googling this, but neither IE nor Firefox can get the msdn.forums,
> complaining the URL will never complete or something, which can be caused by
> not accepting cookies, but that's not the problem.
What version of the Microsoft JDBC driver are you running? Also, can you post your full code? The stack trace in the MSDN posting doesn't seem to match
yours. Am I missing something here?
Evah
--------------------
>Thread-Topic: Connection Reset Error with SQLState() = 08S01
>thread-index: Acfl2ebCd9vu7bnXQLGGWo0+Y3X3Kw==
>X-WBNR-Posting-Host: 209.78.47.227
>From: =?Utf-8?B?V2VzIENsYXJr?= <WesC...@discussions.microsoft.com>
>References: <F0F1C794-A805-4370...@microsoft.com> <F574478C-1843-420F...@microsoft.com>
>Subject: RE: Connection Reset Error with SQLState() = 08S01
>Date: Thu, 23 Aug 2007 16:04:04 -0700
>Lines: 44
>Message-ID: <C7A101C8-BA90-4499...@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2826
>Newsgroups: microsoft.public.sqlserver.jdbcdriver
>Path: TK2MSFTNGHUB02.phx.gbl
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.sqlserver.jdbcdriver:266
>NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
>X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
Evan T. Basalik
This posting is provided “AS IS” with no warranties, and confers no rights.
We turned on a feature of DBCP to run a validation query when getting the
connection from the pool, and that eliminated the connection reset errors.
This implies the connections are going bad while idle in the pool. We saw
these errors when we started running intense batch jobs with long running
queries in the background on the same server using the same pool.
Here's the full stack trace. I had left out the lines from our code.
com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
at
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown
Source)
at com.microsoft.sqlserver.jdbc.TDSWriter.flush(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSWriter.endRequest(Unknown Source)
at
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
at
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.executeStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown
Source)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
at
com.guidewire.pl.system.database.sqlhandler.AbstractPreparedSelectStatementHandler.executeQuery(AbstractPreparedSelectStatementHandler.java:33)
at
com.guidewire.pl.system.database.query.impl.SQLDataHolderPreparedStatementHandler.executeQuery(SQLDataHolderPreparedStatementHandler.java:33)
at
com.guidewire.pl.system.transaction.ConnectionHandlerImpl.executeQuery(ConnectionHandlerImpl.java:374)
at
com.guidewire.pl.system.transaction.ConnectionHandlerImpl.executeQueryCore(ConnectionHandlerImpl.java:310)
at
com.guidewire.pl.system.transaction.ConnectionHandlerImpl.executeQuery(ConnectionHandlerImpl.java:255)
at com.guidewire.pl.system.database.DBKernel.executeQuery(DBKernel.java:49)
at
com.guidewire.pl.system.database.StandardDatabase.read(StandardDatabase.java:514)
at
com.guidewire.pl.system.database.query.impl.QueryExecuterImpl.read(QueryExecuterImpl.java:49)
at
com.guidewire.pl.system.database.query.impl.QueryExecuterImpl.executeQuery(QueryExecuterImpl.java:151)
at
com.guidewire.pl.system.database.query.impl.QueryHelperImpl.doGetKeys(QueryHelperImpl.java:295)
at
com.guidewire.pl.system.database.query.impl.QueryHelperImpl.fetchKeys(QueryHelperImpl.java:58)
at
com.guidewire.pl.system.database.impl.QueryResultImpl.maybeLoadNextChunk(QueryResultImpl.java:103)
at
com.guidewire.pl.system.database.impl.QueryResultImpl.hasNext(QueryResultImpl.java:159)
at
com.guidewire.pl.system.util.CollectionUtil.addAllFromIterator(CollectionUtil.java:380)
at
com.guidewire.pl.system.util.CollectionUtil.buildListFromIterator(CollectionUtil.java:402)
at
com.guidewire.pl.system.database.impl.QueryProcessorBase.getResultsAsList(QueryProcessorBase.java:48)
at
com.guidewire.pl.domain.community.impl.VacationingUsersCacheImpl$VacationingUserEntry.ensureIsLoaded(VacationingUsersCacheImpl.java:47)
at
com.guidewire.pl.domain.community.impl.VacationingUsersCacheImpl$VacationingUserEntry.getVacationingUsers(VacationingUsersCacheImpl.java:39)
at
com.guidewire.pl.domain.community.impl.VacationingUsersCacheImpl.getVacationingUsers(VacationingUsersCacheImpl.java:76)
at
com.guidewire.pl.domain.community.impl.UserBaseImpl.getVacationingUsers(UserBaseImpl.java:478)
at
com.guidewire.cc.web.vacation.VacationFinder.usersOnVacation(VacationFinder.java:31)
at
com.guidewire.cc.web.vacation.VacationFinder.getVacationActivities(VacationFinder.java:40)
at
com.guidewire.cc.domain.activity.ActivityVacationViewFinderImpl.findVacationActivities(ActivityVacationViewFinderImpl.java:19)
at sun.reflect.GeneratedMethodAccessor530.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
This sounds like what would be called a general network error (GNE) in the non-JDBC world. You will likely need to take some network traces to identify the
cause. Most GNEs can be traced down to a piece of hardware inappropriately resetting a connection.
Evan
--------------------
>Thread-Topic: Connection Reset Error with SQLState() = 08S01
>thread-index: Acfp0g8qPEyeL9kcQKqoVf3yalbYDw==
>X-WBNR-Posting-Host: 209.78.47.227
>From: =?Utf-8?B?V2VzIENsYXJr?= <WesC...@discussions.microsoft.com>
>References: <F0F1C794-A805-4370...@microsoft.com> <F574478C-1843-420F...@microsoft.com> <C7A101C8-
BA90-4499-8CF...@microsoft.com> <kd32zVb6...@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Connection Reset Error with SQLState() = 08S01
>Date: Tue, 28 Aug 2007 17:18:01 -0700
>Lines: 89
>Message-ID: <4203A20E-FC68-4CD8...@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2826
>Newsgroups: microsoft.public.sqlserver.jdbcdriver
>Path: TK2MSFTNGHUB02.phx.gbl
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.sqlserver.jdbcdriver:279
>NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
>X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
>
Evan T. Basalik
"Evan T. Basalik (MSFT)" wrote:
> Wes,
>
Because the physical connection to the server is around for a long time, it is not uncommon for network hardware to either intentionally or unintentionally
sever the connection. If you use something like Netmon 3's NMCap and get a client/server trace, you can usually see a reset coming from some
intermediate piece of hardware.
Evan
--------------------
>Thread-Topic: Connection Reset Error with SQLState() = 08S01
>thread-index: Acf0yOITk2erIEWsT12BkkOhjdQfig==
>X-WBNR-Posting-Host: 209.78.47.227
>From: =?Utf-8?B?V2VzIENsYXJr?= <WesC...@discussions.microsoft.com>
>References: <F0F1C794-A805-4370...@microsoft.com> <F574478C-1843-420F...@microsoft.com> <C7A101C8-
BA90-4499-8CF...@microsoft.com> <kd32zVb6...@TK2MSFTNGHUB02.phx.gbl> <4203A20E-FC68-4CD8-A81A-488ECA4286F5
@microsoft.com> <pDlOAXL9...@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Connection Reset Error with SQLState() = 08S01
>Date: Tue, 11 Sep 2007 16:10:02 -0700
>Lines: 15
>Message-ID: <C00A8E92-7A86-4480...@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2929
>Newsgroups: microsoft.public.sqlserver.jdbcdriver
>Path: TK2MSFTNGHUB02.phx.gbl
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.sqlserver.jdbcdriver:298
>NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
>X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
>
Evan T. Basalik
So do you think the network hardware is responsible for the connection reset
issues?
TIA,
--
Manoj Kumar
Evan
--------------------
>Thread-Topic: Connection Reset Error with SQLState() = 08S01
>thread-index: AcgmDkAFGmLQCwb6TMeXpIs7qVvv5w==
>X-WBNR-Posting-Host: 207.46.19.168
>From: =?Utf-8?B?TWFub2ogS3VtYXI=?= <Manoj...@discussions.microsoft.com>
>References: <F0F1C794-A805-4370...@microsoft.com> <F574478C-1843-420F...@microsoft.com> <C7A101C8-
BA90-4499-8CF...@microsoft.com> <kd32zVb6...@TK2MSFTNGHUB02.phx.gbl> <4203A20E-FC68-4CD8-A81A-488ECA4286F5
@microsoft.com> <pDlOAXL9...@TK2MSFTNGHUB02.phx.gbl> <C00A8E92-7A86-4480...@microsoft.com>
<rKN7lYg#HHA...@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Connection Reset Error with SQLState() = 08S01
>Date: Tue, 13 Nov 2007 08:00:02 -0800
>Lines: 72
>Message-ID: <5D455AB7-1900-4F31...@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2992
>Newsgroups: microsoft.public.sqlserver.jdbcdriver
>Path: TK2MSFTNGHUB02.phx.gbl
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.sqlserver.jdbcdriver:342
>NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
>X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
19/11/2007 16:37:23.320 Thread-22200 threw
encoded.util.storage.UpdateException:
com.microsoft.sqlserver.jdbc.SQLServerException: Socket closed
at encoded.users.ServiceLogStorer.updateStorable(ServiceLogStorer.java:197)
at encoded.users.ServiceLogStorer.updateStorable(ServiceLogStorer.java:35)
at encoded.util.storage.AbstractStorer.update(AbstractStorer.java:111)
at encoded.util.storage.BackedStorable.update(BackedStorable.java:98)
at encoded.users.ServiceLog.end(ServiceLog.java:299)
at
encoded.ivr.nwo.NwoIvrService$ServiceController.resourcesFreed(NwoIvrService.java:432)
at
encoded.ivr.nwo.ResourceFactory$_FactoryListener.resourceFreed(ResourceFactory.java:489)
at
encoded.ivr.nwo.AbstractFreeable$_ResourceListenerAdapter.eventArrived(AbstractFreeable.java:267)
at
encoded.ivr.nwo.AbstractFreeable$_ResourceListenerAdapter.eventArrived(AbstractFreeable.java:245)
at
uk.co.encoded.core.util.dispatch.SimpleDispatcher$_DispatchThread.run(SimpleDispatcher.java:641)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Socket closed
at
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown
Source)
at com.microsoft.sqlserver.jdbc.TDSChannel.write(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSWriter.flush(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSWriter.writePacket(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSWriter.endMessage(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source)
at
com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown
Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown
Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown
Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown
Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeUpdate(Unknown
Source)
at
uk.co.encoded.core.sql.StatementWrapper.executeUpdate(StatementWrapper.java:281)
at uk.co.encoded.core.sql.Odbc.executeUpdate(Odbc.java:480)
at encoded.users.ServiceLogStorer.updateServiceLog(ServiceLogStorer.java:454)
at encoded.users.ServiceLogStorer.updateStorable(ServiceLogStorer.java:194)
... 10 more
This is being run practically directly from the client to the server, with
only one switch sitting between the client and the server (no firewalls,
nothing fancy, just a normal switch). It also happens in exactly the same
place every time (whilst ending the message in order to start the response).
My gut feeling is that this isn't a network problem.
> >> This posting is provided “AS IS†with no warranties, and confers no rights.
However, if this is pretty reproducible, it could be that for some reason the code path is generating a bad TDS packet that is being rejected by the server or
somehow the code path is resulting in a SPID dying on the SQL Server side.
Do you see anything in the SQL Server error logs that matches the failure time?
To be honest, digging into this further is likely going to be tough via the newsgroup. If this is a serious issue for you, I would probably recommend that you
open up a support case with us. Then, we can do things like look at network traces, etc.
Evan
--------------------
>Thread-Topic: Connection Reset Error with SQLState() = 08S01
>thread-index: Acgq0fP4rcl9jWMKRKuACVnUKrd9OA==
>X-WBNR-Posting-Host: 88.96.233.102
>From: =?Utf-8?B?dGhlaG9sbHlob3Bkcml2ZQ==?= <theholly...@discussions.microsoft.com>
>References: <F0F1C794-A805-4370...@microsoft.com> <F574478C-1843-420F...@microsoft.com> <C7A101C8-
BA90-4499-8CF...@microsoft.com> <kd32zVb6...@TK2MSFTNGHUB02.phx.gbl> <4203A20E-FC68-4CD8-A81A-488ECA4286F5
@microsoft.com> <pDlOAXL9...@TK2MSFTNGHUB02.phx.gbl> <C00A8E92-7A86-4480...@microsoft.com>
<rKN7lYg#HHA...@TK2MSFTNGHUB02.phx.gbl> <5D455AB7-1900-4F31...@microsoft.com> <XXoaahjJIHA.4268
@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Connection Reset Error with SQLState() = 08S01
>Date: Mon, 19 Nov 2007 09:31:00 -0800
>Lines: 180
>Message-ID: <A7098B45-CE3B-49F6...@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2992
>Newsgroups: microsoft.public.sqlserver.jdbcdriver
>Path: TK2MSFTNGHUB02.phx.gbl
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.sqlserver.jdbcdriver:347
>NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
>X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
>
> >> >> This posting is provided “AS IS†with no warranties, and confers no rights.
Evan
--------------------
>Thread-Topic: Connection Reset Error with SQLState() = 08S01
>thread-index: Acg7e4PlgDMwAL9XRlKTu+rh2j7noQ==
>X-WBNR-Posting-Host: 207.46.19.197
>From: =?Utf-8?B?SGFud2Vjaw==?= <Han...@discussions.microsoft.com>
>References: <F0F1C794-A805-4370...@microsoft.com> <F574478C-1843-420F...@microsoft.com> <C7A101C8-
BA90-4499-8CF...@microsoft.com> <kd32zVb6...@TK2MSFTNGHUB02.phx.gbl> <4203A20E-FC68-4CD8-A81A-488ECA4286F5
@microsoft.com> <pDlOAXL9...@TK2MSFTNGHUB02.phx.gbl> <C00A8E92-7A86-4480...@microsoft.com>
<rKN7lYg#HHA...@TK2MSFTNGHUB02.phx.gbl> <5D455AB7-1900-4F31...@microsoft.com> <XXoaahjJIHA.4268
@TK2MSFTNGHUB02.phx.gbl> <A7098B45-CE3B-49F6...@microsoft.com> <Nme5zj8K...@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Connection Reset Error with SQLState() = 08S01
>Date: Mon, 10 Dec 2007 14:25:06 -0800
>Lines: 239
>Message-ID: <BE45AFFC-8570-48D0...@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2992
>Newsgroups: microsoft.public.sqlserver.jdbcdriver
>Path: TK2MSFTNGHUB02.phx.gbl
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.sqlserver.jdbcdriver:367
>NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
>X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
>
>I'm getting the same error running the application locally on the same
>machine as SQL Server 2005. No NIC, no switches. This is a bug.
>
>"Evan T. Basalik (MSFT)" wrote:
>
>> Well, technically, you still have a couple network cards in the mix, so one of them could be the source of the problem. I do agree that a switch is unlikely
to
>> be the source for a dropped packet.
>>
>> However, if this is pretty reproducible, it could be that for some reason the code path is generating a bad TDS packet that is being rejected by the server
or
>> somehow the code path is resulting in a SPID dying on the SQL Server side.
>>
>> Do you see anything in the SQL Server error logs that matches the failure time?
>>
>> To be honest, digging into this further is likely going to be tough via the newsgroup. If this is a serious issue for you, I would probably recommend that
you
>> open up a support case with us. Then, we can do things like look at network traces, etc.
>>
>> Evan
>> --------------------
>> >Thread-Topic: Connection Reset Error with SQLState() = 08S01
>> >thread-index: Acgq0fP4rcl9jWMKRKuACVnUKrd9OA==
>> >X-WBNR-Posting-Host: 88.96.233.102
>> >From: =?Utf-8?B?dGhlaG9sbHlob3Bkcml2ZQ==?= <theholly...@discussions.microsoft.com>
>> >References: <F0F1C794-A805-4370...@microsoft.com> <F574478C-1843-420F...@microsoft.com>
<C7A101C8-