none
Exception from DBComms.receive.method RRS feed

  • Question

  • Hi,

    I am getting SQLException when I  connect one of SQL Server 2000 Integrated Security host.  I would like to know how to correct this problem.

    An exception occurred during the DBComms.receive method. Operation:An existing connection was forcibly closed by the remote host. Context:(1) [Thread[main,5,main], IO:adc97, Dbc:8460d]. PktNum:1. TotalReceived:173. PktSize:4,096.

    Thanks.

    Tuesday, July 11, 2006 4:47 PM

Answers

  • Hi Rao,

     

    Does your app use the same PreparedStatement object simultaneously from multiple threads?  The SQL Server JDBC driver does not support such freethreaded use.  It does, however, support executing different PreparedStatement instances (created from the same Connection) on multiple threads.

     

    Would you be willing to post your standalone app to this thread?

     

    Thanks,

    --David Olix [MSFT]

    Friday, July 13, 2007 2:21 AM
    Moderator

All replies

  • Same here, for some write operations it throws the same exception.

    I am using the SQL Server 2005 JDBC driver  version 1.1.1320.0. In the previous version, it does not happen.

    Regards,
    Ricardo

    Wednesday, July 12, 2006 8:50 PM
  • Hi Ricardo, Alexie,

    Could you provide a stack trace for this exception along with more details about the application code, SQL statements involved, connection properties, version of SQL Server, etc.?  This is a general error message that is raised whenever the SQL server forcibly closes the TCP/IP connection for any of a number of reasons while the driver is waiting for a response to a query.

    Thank you,

    --David Olix

    JDBC Development

    Wednesday, July 26, 2006 5:05 AM
    Moderator
  • hi,

    may i know if any one of you have any updates for this? found the cause of the problem?

    i had face the same problem too..

    Monday, January 22, 2007 3:11 PM
  • Same here I'm having the same problem or maybe slightly different I receive the error:

    Code Snippet
    Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: An exception occurred during the DBComms.receive method. Operation:Connection reset. Context:(1) [Thread[main,5,main], IO:fd5e2, Dbc:2f9ee]. PktNum:1. TotalReceived:170. PktSize:4,096.

     

    The following lines of code are what triggers the error:

    Code Snippet

    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

    String connectionUrl = "jdbc:sqlserver://localhost;database=TMIS-development;integratedSecurity=true;";
      Connection con = DriverManager.getConnection(connectionUrl);

     

    The following is the stack trace:

    Code Snippet
    Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: An exception occurred during the DBComms.receive method. Operation:Connection reset. Context:(1) [Thread[main,5,main], IO:2961b, Dbc:d03f9]. PktNum:1. TotalReceived:170. PktSize:4,096.
            at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
            at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
            at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown Source)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
            at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(DriverManager.java:582)
            at java.sql.DriverManager.getConnection(DriverManager.java:207)
            at importclmdata.Clm.<init>(Clm.java:90)
            at importclmdata.Main.main(Main.java:35)
    Java Result: 1

     

     

     

    This is running on a 2003 server and MS SQL 2005

    Tuesday, March 27, 2007 12:05 AM
  • Could you get me a FINEST log output from the driver. Is userid and password authentication working fine?
    Wednesday, March 28, 2007 6:09 PM
    Moderator
  • I have the same problem.  I use SQL 2005 with a jboss.  

    The connection works well some minutes before having the exception.  

    It's a sample from my configuration.

    Code Snippet

    <?xml version="1.0" encoding="UTF-8"?>
    <datasources>
       <local-tx-datasource>
             <jndi-name>MYDS</jndi-name>
             <connection-url>jdbc:sqlserver://myServer:1216;instanceName=myInstance;databaseName=myDatabaseName</connection-url>
             <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
             <user-name>myUserName</user-name>
             <password>myPassword</password>
       </local-tx-datasource>
    </datasources>

    Thursday, April 5, 2007 2:31 PM
  • I'm ha ving the same problem I think.

    Using a multithreaded java application, sometimes I get an error, I'm using MS SQL 2005.

    Code Snippet
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The DBComms.receive operation resulted in an invalid packet header type:-127.  PktNum:0.  nReceived:8.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.sendCommand(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteQuery(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1778)
    at org.hibernate.loader.Loader.doQuery(Loader.java:662)




    Just saw that there was a new release of the JDBC driver (2/2 2007), going to try that one and see if it works better.
    Tuesday, April 10, 2007 6:38 AM
  • I have also get same problem. Did any one of you could solve this problem.
    2007-04-11 15:10:54,062 INFO  [DBFunctions]  Kullanici ?ifre kontrolünde hata : An exception occurred during the DBComms.receive method. Operation:Connection reset. ContextSad708) [Thread[http-0.0.0.0-443-6,5,jboss], IO:7e040, Dbc:396f0]. PktNum:0. TotalReceived:0. PktSize:4,096.
    2007-04-11 15:10:54,062 ERROR [STDERR] com.microsoft.sqlserver.jdbc.SQLServerException: An exception occurred during the DBComms.receive method. Operation:Connection reset. ContextSad708) [Thread[http-0.0.0.0-443-6,5,jboss], IO:7e040, Dbc:396f0]. PktNum:0. TotalReceived:0. PktSize:4,096.
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.executeStatement(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.erdemir.globals.DBFunctions.userLogin(DBFunctions.java:27)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.erdemir.globals.User.checkUser(User.java:37)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:585)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at javax.faces.component.UICommand.broadcast(UICommand.java:106)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.erdemir.globals.CustomFacesServlet.service(CustomFacesServlet.java:50)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:67)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:223)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:595)
    Wednesday, April 11, 2007 12:49 PM
  • I have similar problem when i use jboss and MS SQL Server 2005. I get this error one week later from application begins. Do you have any idea. Thanks..

    2007-04-11 15:10:54,062 INFO  [DBFunctions] Error: An exception occurred during the DBComms.receive method. Operation:Connection reset. ContextSad708) [Thread[http-0.0.0.0-443-6,5,jboss], IO:7e040, Dbc:396f0]. PktNum:0. TotalReceived:0. PktSize:4,096.
    2007-04-11 15:10:54,062 ERROR [STDERR] com.microsoft.sqlserver.jdbc.SQLServerException: An exception occurred during the DBComms.receive method. Operation:Connection reset. ContextSad708) [Thread[http-0.0.0.0-443-6,5,jboss], IO:7e040, Dbc:396f0]. PktNum:0. TotalReceived:0. PktSize:4,096.
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.executeStatement(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.erdemir.globals.DBFunctions.userLogin(DBFunctions.java:27)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.erdemir.globals.User.checkUser(User.java:37)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:585)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at javax.faces.component.UICommand.broadcast(UICommand.java:106)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.erdemir.globals.CustomFacesServlet.service(CustomFacesServlet.java:50)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:67)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:223)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:595)
    Wednesday, April 11, 2007 12:54 PM
  • I have similar problem when i use jboss and MS SQL Server 2005. I get this error one week later from application begins. Do you have any idea. Thanks..

    2007-04-11 15:10:54,062 INFO  [DBFunctions] Error: An exception occurred during the DBComms.receive method. Operation:Connection reset. ContextSad708) [Thread[http-0.0.0.0-443-6,5,jboss], IO:7e040, Dbc:396f0]. PktNum:0. TotalReceived:0. PktSize:4,096.
    2007-04-11 15:10:54,062 ERROR [STDERR] com.microsoft.sqlserver.jdbc.SQLServerException: An exception occurred during the DBComms.receive method. Operation:Connection reset. ContextSad708) [Thread[http-0.0.0.0-443-6,5,jboss], IO:7e040, Dbc:396f0]. PktNum:0. TotalReceived:0. PktSize:4,096.
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.executeStatement(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.erdemir.globals.DBFunctions.userLogin(DBFunctions.java:27)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.erdemir.globals.User.checkUser(User.java:37)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:585)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at javax.faces.component.UICommand.broadcast(UICommand.java:106)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at com.erdemir.globals.CustomFacesServlet.service(CustomFacesServlet.java:50)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:67)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:223)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    2007-04-11 15:10:54,062 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:595)
    Wednesday, April 11, 2007 12:58 PM
  • Umut are you using the 1.1 driver. There is not enough info in the traces you provided to come to a conclusion. Can you say what query gets executed when this error occurs? Did you look to see at the server, if there are any errors reproted in the server error log?
    Tuesday, May 1, 2007 11:06 PM
    Moderator
  • I have the same problem on SQL2005 JDBC Driver(v1.1).
    How do I resolve this problem?

    Here is my exception stacktrace:


    Code Snippet


    org.hibernate.SessionException: Session was already closed
        at org.hibernate.impl.SessionImpl.close(SessionImpl.java:275)
        at org.springframework.orm.hibernate3.SessionFactoryUtils.closeSession(SessionFactoryUtils.java:774)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.closeSession(OpenSessionInViewFilter.java:280)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:208)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.ppolis.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:145)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
        at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:183)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:125)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
        at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:78)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.ppolis.webapp.filter.UrlCacheFilter.doFilter(UrlCacheFilter.java:195)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:619)
    Orz...[PPolis] ERROR: [http-9080-Processor22] org.apache.catalina.core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:704) | Servlet.service() for servlet default threw exception
    org.hibernate.TransactionException: JDBC begin failed:
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:68)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
        at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:510)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:349)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:259)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:203)
        at $Proxy2.getUserByUserId(Unknown Source)
        at com.ppolis.webapp.action.UserPageAction.prepare(UserPageAction.java:90)
        at com.opensymphony.xwork.interceptor.PrepareInterceptor.before(PrepareInterceptor.java:77)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:30)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:100)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.ppolis.webapp.interceptor.ActionResultCodeInterceptor.intercept(ActionResultCodeInterceptor.java:81)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:113)
        at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:233)
        at com.ppolis.webapp.filter.WebWorkFilterDispatcher.doFilter(WebWorkFilterDispatcher.java:125)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:130)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.ppolis.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:145)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
        at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:183)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:125)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
        at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:78)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.ppolis.webapp.filter.UrlCacheFilter.doFilter(UrlCacheFilter.java:195)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:619)
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: DBComms.receive 方法期間發生例外狀況。作業: 遠端主機已強制關閉一個現存的連線。。內容: (3) [Thread[http-9080-Processor22,5,main], IO:d67cf, Dbc:3882a]。PktNum: 0。TotalReceived: 0。PktSize: 4,096。
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
        at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
        at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.doConnectionCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection$ConnectionCommandRequest.execute(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectionCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.setAutoCommit(Unknown Source)
        at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:268)
        at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:293)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)
        ... 76 more
    Orz...[PPolis] ERROR: [http-9080-Processor22] org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:253) | Servlet.service() for servlet default threw exception
    org.hibernate.TransactionException: JDBC begin failed:
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:68)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
        at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:510)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:349)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:259)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:203)
        at $Proxy2.getUserByUserId(Unknown Source)
        at com.ppolis.webapp.action.UserPageAction.prepare(UserPageAction.java:90)
        at com.opensymphony.xwork.interceptor.PrepareInterceptor.before(PrepareInterceptor.java:77)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:30)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:100)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.ppolis.webapp.interceptor.ActionResultCodeInterceptor.intercept(ActionResultCodeInterceptor.java:81)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
        at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:113)
        at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:233)
        at com.ppolis.webapp.filter.WebWorkFilterDispatcher.doFilter(WebWorkFilterDispatcher.java:125)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:130)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.ppolis.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:145)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
        at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:183)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:125)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
        at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:78)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.ppolis.webapp.filter.UrlCacheFilter.doFilter(UrlCacheFilter.java:195)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:619)
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: DBComms.receive 方法期間發生例外狀況。作業: 遠端主機已強制關閉一個現存的連線。。內容: (3) [Thread[http-9080-Processor22,5,main], IO:d67cf, Dbc:3882a]。PktNum: 0。TotalReceived: 0。PktSize: 4,096。
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
        at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
        at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.doConnectionCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection$ConnectionCommandRequest.execute(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectionCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.setAutoCommit(Unknown Source)
        at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:268)
        at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:293)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)
        ... 76 more


    Thursday, May 10, 2007 11:02 AM
  • Has anyone tried the 1.2 driver?  I've been seeing this with some degree of regularity too with the 1.1 driver.

    I'm using:

    JDBC Driver: Microsoft SQL Server 2005 JDBC Driver version 1.1.1501.101
    SQL Server: Microsoft SQL Server version 9.00.1399
    Java: Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_11-b03, mixed mode)
    Client O/S: Linux garlic 2.6.20-15-generic #2 SMP Sun Apr 15 06:17:24 UTC 2007 x86_64 GNU/Linux

    and am seeing the same problem sometimes but not always.  It seems to happen more on a quad core box than on a dual core box.

    There are no error messages in the SQL server log file.  I'll try the 1.2 driver to see if it is any different.
    Thursday, May 24, 2007 3:30 PM
  • Has anyone had any luck pinning the issue to any probable cause/s?

     

    We see it randomly so far on the following setup:

     

    Database Product Version 9.00.1399

    Driver Name Microsoft SQL Server 2005 JDBC Driver

    Driver Version 1.1.1501.101

    Driver Major Version 1

    Driver Minor Version 1

    JDK 1.5 update 10 on 64 bit AMD 2 dual core machine.

     

    thanks

    -giriraj

    Wednesday, June 20, 2007 8:39 PM
  • Could you try the 1.2 CTP and see if it solves the problem. We did have a problem with our driver where some of the transaction requests like commmit could cause problem if there is a statement executing using the same connection.
    Thursday, June 21, 2007 8:58 PM
    Moderator
  • 1.2 did not solve the problem for me. It seems to be race condition of some sort as the more processors I have the more frequent the problem happens. I know that these are some of the hardest problems to track down though.

    This occurs frequently enough that if I could turn on some debugging of some sort it may point to the  issue.  Are there some flags of some sort that can be used to debug more?
    Friday, June 22, 2007 2:14 PM
  • On the JDBC client side, you could use JDBC tracing. Please use FINE level.

    http://msdn2.microsoft.com/en-us/library/ms378517.aspx

     

    Friday, June 22, 2007 4:12 PM
    Moderator
  • Hi MSFT folks

     

    Can we also turn tracing level on the SQL Server side? Should we see anything at all in the Server log? It seems like there is nothing reported in the logs.

     

    Also, what is the impact of turning the trace level to FINE on client side JDBC?

     

    Thanks

    -giriraj

    Wednesday, June 27, 2007 8:16 PM
  • Hi MSFT folks

     

    Also, could you please elaborate what is causing the Connection to be reset/closed? Is it the SQL Server or is it a Driver issue? Should i focus more on the client side (JDBC) or look at SQL Server to isolate the issue?

     

    Thanks

    -giriraj

    Wednesday, June 27, 2007 10:35 PM
  • This is a client issue not a server issue. You are likely not to see any issues on the server. FINE trace obviously have some perf impact. You should probably do the tracing in a test enviroment rather than on a production system.
    Friday, June 29, 2007 8:40 PM
    Moderator
  • I have the same problem. Just moved from SQL server 2000 to SQL server 2005, and now I get this error randomly. Never seenit before.

     

    I am running

     

    JDK 1.4

    MS JDBC driver 1.1

     

    Anyone knows a fix for this problem

     

    thanks,

     

    Rasmus

    Wednesday, July 11, 2007 1:07 AM
  • Hi,

      We are experiencing the same problem of DBComms exception and have tried all the ideas in different forums. The exception is random.

    Setup:

    Multi threaded application running in (each thread executing select SQL Statements )

    Websphere 6.0.0.1, SQL Server 2005 SP2

    Websphere and SQL Server running on different machines

     We tried the following

    1. Changed the drivers from Websphere provided to MS provided 1.1

    2. Modified processor affinity so that SQL Server uses single processor instead of multi processor

     

    No exception in SQL Server trace or logs

    But we still get the exception in websphere logs.

    Any help would be greatly appreciated

     

    -Rao

    Wednesday, July 11, 2007 10:18 AM
  • An update, We have used 1.2 ctp as mentioned in an earlier post. Now the exception is different. DSRA91108: Connection is closed. Looks like the only change in the driver between 1.1 and 1.2 is that they have removed the DBComms.receive message
    Thursday, July 12, 2007 6:09 AM
  • An update, We have used 1.2 ctp as mentioned in an earlier post. Now the exception is different. DSRA91108: Connection is closed. Looks like the only change in the driver between 1.1 and 1.2 is that they have removed the DBComms.receive message
    Thursday, July 12, 2007 6:10 AM
  • Another update.

    We tested with a standalone java application that creates n number of threads and executes m selects in each thread. n=50, m=400. We use SQL Server latest driver 1.2 CTP. We encounter the following exception (same as previous one).

    com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
        at com.microsoft.sqlserver.jdbc.TDSChannel.read(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)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
        at sample.task.Task.executeAllQueries(Task.java:42)
        at sample.thread.threads.TaskExecuterThread.run(TaskExecuterThread.java:25)
        at java.lang.Thread.run(Unknown Source)

     

    Looks like an issue purely with SQL Server and/or SQL Server JDBC Driver.

     

    Please help!

    Thursday, July 12, 2007 8:03 AM
  • Hi Rao,

     

    Does your app use the same PreparedStatement object simultaneously from multiple threads?  The SQL Server JDBC driver does not support such freethreaded use.  It does, however, support executing different PreparedStatement instances (created from the same Connection) on multiple threads.

     

    Would you be willing to post your standalone app to this thread?

     

    Thanks,

    --David Olix [MSFT]

    Friday, July 13, 2007 2:21 AM
    Moderator
  • Hi David,

     

    Thanks for replying. PreparedStatements are not shared  across threads. Each thread creates a fresh connection, creates PreparedStatements using the connection and executes them. We do not use any connection pooling mechanism.

     

    Please find below the code used in the sample application. We cannot however share the actual SQL queries used, but they are select statements hitting tables that have an average of 1,000,000 rows, and the returned  ResultSets contain an average of 100 rows.-

     

    The main class -

     

    Code Snippet

    public class MultiThreadedApplication {
     private ThreadFactory threadFactory;
     public MultiThreadedApplication() {
      threadFactory = ThreadFactory.getInstance();
     }
     
     public static void main(String[] args) throws Exception {
      if (args.length == 0){
       System.out.println("Usage: MultiThreadedApplication 10 10");
       System.out.println("\t Here first parameter represents number of threads");
       System.out.println("\t second parameter represents number of tasks per threads");
       System.exit(0);
      }else{
       int numberOfThreads = Integer.parseInt(args[0]);
       int numberofTasks = Integer.parseInt(args[1]);
       
       // Uncomment below two code lines if you want to move the
       // print statements to sample log files
       
       //System.setOut(new PrintStream(new FileOutputStream(new File("output.txt"))));
       //System.setErr(new PrintStream(new FileOutputStream(new File("error.txt"))));
       
       System.out.println("Starting Application...");
       
       MultiThreadedApplication application = new MultiThreadedApplication();
       TaskExecuterThread[] threads = application.threadFactory.
            createThreads(numberOfThreads,numberofTasks);
       for (int i=0 ; i< threads.length; i++){
        Thread t = new Thread(threads[i]);
        t.start();
       }
      }
     }
    }

     

    TaskExecutorThread -

     

    Code Snippet

    public class TaskExecuterThread implements Runnable{
     
     private Task[] tasks;
     public TaskExecuterThread(int numberofTasks) {
      Connection connection = Connectionfactory.getInstance().getConnection();
      tasks = create(numberofTasks,connection);
     }

     private Task[] create(int numberofTasks, Connection connection) {
      Task[] temp = new Task[numberofTasks];
      for(int i=0;i<NUMBEROFTASKS;I++){
       temp[i] = new Task(connection);
      }
      return temp;
     }

     public void run() {
      for (int i = 0; i < tasks.length; i++) {
       tasks[i].executeAllQueries();
      }
     }

    }

     

    Task

     

    Code Snippet

    public class Task {

     private Connection con;
     private PreparedStatement[] statements;
     public Task(Connection connection) {
      con = connection;
      populateQueries();
     }
     
     private void populateQueries() {
      statements = new PreparedStatement[8];
      try {
       
       statements[0] = con.prepareStatement(SQLQueries.QUERY_SMI_GET_CONTRACTS);
       statements[1] = con.prepareStatement(SQLQueries.QUERY_SMI_LIFE_COUNT);
       statements[2] = con.prepareStatement(SQLQueries.QUERY_SMI_SELECT_ADVISOR_FOR_SM);
       statements[3] = con.prepareStatement(SQLQueries.QUERY_SMI_ADVISOR_FYC);
       statements[4] = con.prepareStatement(SQLQueries.QUERY_SMI_ACCELERATOR);
       statements[5] = con.prepareStatement(SQLQueries.QUERY_GS_GET_CONTRACTS);
       statements[6] = con.prepareStatement(SQLQueries.QUERY_GS_LIFE_COUNT);
       statements[7] = con.prepareStatement(SQLQueries.QUERY_GS_LAPSED_LIVES);
       
      } catch (SQLException e) {
       e.printStackTrace();
      }
       
      
     }

     public void executeAllQueries() {
      for (int i = 0; i < statements.length; i++) {
       try {
        ResultSet rSet = statements[i].executeQuery();
       } catch (SQLException e) {
        e.printStackTrace();
       }
      }
      System.out.println("======= A set of all Queries execution completed by a thread =======");
     }
    }

     

    SQLQueries contains SQL query strings.

     

    ThreadFactory

     

    Code Snippet
    public class ThreadFactory {
     private static ThreadFactory self;
     
     private ThreadFactory(){
      
     }
     
     public static ThreadFactory getInstance(){
      if (self == null)
       self = new ThreadFactory();
      
      return self;
     }
     
     public TaskExecuterThread[] createThreads(int numberOfThreads, int numberofTasks){
      TaskExecuterThread[] threads = new TaskExecuterThread[numberOfThreads];
      for (int i=0;i<NUMBEROFTHREADS;I++){
       threads[i] = new TaskExecuterThread(numberofTasks);
      }
      return threads;
     }
    }

     

    IConnectionProvider

     

    Code Snippet

    public interface IConnectionProvider {
     
     /**
      * Subclass should implement this method and should return
      * appropriate connection
      * @return
      */
     Connection getConnection();

    }

     

    Connectionfactory - implementation of IConnectionProvider.  

     

    Code Snippet

    public class Connectionfactory implements IConnectionProvider{
     
     private static final String DRIVER = "Driver";
     private static final String URL = "URL";
     private static final String USER = "User";
     private static final String PASSWORD = "Password";
     private static Connectionfactory self;
     private Properties properties;
     private Connectionfactory(){
      loadProperties();
     }
     
     private void loadProperties() {
      properties = new Properties();
      InputStream inputStream = getClass().getClassLoader().
              getResourceAsStream("jdbcconnection.properties");
      try {
       properties.load(inputStream);
      } catch (IOException e) {
       e.printStackTrace();
      }
     }

     public static Connectionfactory getInstance(){
      if (self == null){
       self = new Connectionfactory();
      }
      return self;
     }
     public Connection getConnection(){
      Connection connection = null;
      
      String driverClassName = (String) properties.get(DRIVER);
      String url = (String) properties.get(URL);
      String user = (String) properties.get(USER);
      String password = (String) properties.get(PASSWORD);

      try {
       Class.forName(driverClassName);
       connection = DriverManager.getConnection(url, user, password);
      } catch (ClassNotFoundException e) {
       e.printStackTrace();
      } catch (SQLException e) {
       e.printStackTrace(); 
      }
      
      return connection;
     }
    }

     

     

     

    Regards,

    Rao Tamma

     

    Friday, July 13, 2007 6:03 AM
  • Hi Rao,

     

    Thank you for posting the sample code.

     

    With each Connection bound to a different thread and PreparedStatements created from those connections not being shared among threads, you shouldn't be hitting any multithreading issues.  And with all of the queries presumably generating forward only read only ResultSets, I can't see there being any updatability issues either.  Without being able to see any of the SQL involved, I don't have much of a guess as to why the connections are getting closed.  But each Task uses its connection several times (8 queries per Task, each Task executed 10 times per Thread = 80 queries per Connection, right?), so when a connection is closed for whatever reason, subsequent queries using that same connection (on the same Task) would fail with the exception indicated.

     

    Let's see, some questions that may help with diagnosis...:

     

    If you have captured FINEST level traces, can you have a look through these to see if you can determine whether there was any error returned from the server that would have closed the connection?

     

    One idea to simplify things: If none of the queries is parameterized, can you try using regular Statement objects rather than PreparedStatement?  If that solves the problem, then it likely is a driver issue.

     

    What connection properties are you using?  Approximately how large (in terms of bytes) are the ResultSets?  For example 100 rows * approximate size of data per row.  The driver should not have any problem with the size of the table, unless you are selecting the entire table.  In that case, you'll probably want to use a server cursor (selectMethod=cursor, v1.1/v1.2) or adaptive buffering (responseBuffering=adaptive, v1.2 only).

     

    Regards,

    --David Olix [MSFT]

    Sunday, July 15, 2007 7:07 PM
    Moderator
  • Hi Rao,

     

    Any updates? Please post any findings as seems like you have a reproducible case.

     

    Thanks

     

    -giriraj

    Friday, July 20, 2007 9:00 PM
  • Hi Giriraj,

       We were able to workaround the issue by making our application single threaded. Another workaround is to connect the application server and SQL server machine directly

    Regards,

    -Rao

     

    Monday, July 23, 2007 10:06 AM
  • Hello Rao

     

    Thanks for the response.

     

    Could you please email me at giriraj.vengurlekar at gmail - i would like to ask you a few questiosn if you do not mind.

     

    Thanks again.

     

    -giriraj

    Wednesday, July 25, 2007 5:13 PM
  •  

    Regarding the Exception from DBComms.receive.method issue on

     

    http://forums.microsoft.com/msdn/showpost.aspx?postid=545001&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=2

     

    it says there the issue was answered but it sure doesn’t seem that way.  What was the final answer?  Surely not single-threading the app?  I say “surely not” because my app is already singly threaded.

     

    Any luck?

     

    Thanks,

     

    Harry

    Monday, October 8, 2007 5:48 PM
  • Regarding the Exception from DBComms.receive.method issue on

     

    http://forums.microsoft.com/msdn/showpost.aspx?postid=545001&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=2

     

    it says there the issue was answered but it sure doesn’t seem that way.  What was the final answer?  Surely not single-threading the app?  I say “surely not” because my app is already singly threaded.

     

    Any luck?

     

    Thanks,

     

    Harry

     

    Monday, October 8, 2007 5:48 PM
  • Hi,

     

    Connections can be closed for a number of reasons.  Which might be why this thread is so popular...

     

    First, are you still seeing the problem with the v1.2 (CTP) driver?  If not, I highly recommend trying that one as it contains a fix for one bug known to cause this error.

     

    If you are using the v1.2 driver, and you can positively rule out transient network connectivity issues and multithreaded usage, the next most common cause I am aware of is where a connection pool is being used and the pooling manager (e.g. DBCP or C3PO) does not test pooled connections for validity before handing them out to the app.  What happens in this case is connections that sit idle in the pool for a very long time get closed by the TCP/IP stack, routing hardware, etc.  Then they're already dead when the pooling manager hands them out.  The solution is to configure the pooling manager to validate connections before handing them out, typically using a validation query like "SELECT 1".

     

    If this scenario doesn't apply to you either, then I am not aware of any other "easy" answers at the moment.  Diagnosing connection failures can be a long process.  If you don't find your answer in the forums, please consider contacting Microsoft Customer Support and talking to one of our JDBC folks there.  They can help with a more involved diagnosis.

     

    Regards,

    --David Olix [MSFT]

    Monday, October 8, 2007 8:35 PM
    Moderator
  • Hi,

     

    I have experience this problem recently. Does somebody find solution?

    Version 1.2 of driver did not help to me.

     

    Regards,

     

    Friday, June 20, 2008 7:20 AM
  • hi

            i have the same issue. using sql server 2005 driver i get the error sometimes. the connection is getting closed because of it during transaction. did u solve the problem
    Tuesday, July 1, 2008 11:53 AM
  • No. I'm still searching for solution.

    I will post solution here in case I found it.

     

    Maybe there are some Microsoft personnel who we can ask for help.

     

    Monday, July 7, 2008 9:11 AM
  • Hey folks,

     

    As someone in the Microsoft organization who is responsible for supporting both the JDBC driver and general connectivity, I can say with great confidence that the types of error messages being reported on this thread are pretty unlikely to be caused by the JDBC driver itself.

     

    Instead, I would look closer at the TCP stack or the networking infrastructure as they are a more likely source of the problem.  In the JDBC world, we tend to see connectivity problems manifest as "An existing connection was forcibly closed by the remote host" or "Connection reset."  In the non-JDBC world (MDAC, WDAC, or .NET), this would be manifesting as "General Network Error' or "Communication Link Failure."

     

    Prior to the release of Windows 2003 SP2, I would have 99.999% of the time the problem was misbehaving NICs, misbehaving routers, or misbehaving firewalls.  Unfortunately, Windows 2003 SP2 had some real problems with the scalable networking features that were implemented.  The solution to those is to turn off scalable networking as per (http://support.microsoft.com/default.aspx?scid=kb;EN-US;936594).

     

    If the problem persists after that, you are going to have to start using network traces to track down the misbehaving hardware.  Unfortunately, if you need assistance with reading network traces, it is pretty hard to read them in the context of a forum thread.  At that point, you really need to look at opening up a case with Microsoft Support (i.e., folks like me).    Then, we can get your network traces in-house and start digging through them to see if we can identify the hardware issue.

     

    Evan

     

    Tuesday, July 15, 2008 1:34 AM
  • Thanks Evan.

    I also have assumed that problem can be with some network setting.

    Even though Java application and MS SQL server are hosted on same machine maybe NIC driver makes problem. 

     

    Monday, July 21, 2008 9:36 AM
  • Branko,

     

    Scalable Networking shouldn't really come into play with a local connection since we don't get far enough down the TCP stack. 

     

    The DBComms error should only come with the v1.1 driver or lower.  What happens with the v1.2 driver?

     

    Evan

    Tuesday, July 22, 2008 9:19 PM
  • Evan,

     

    Same situation with v1.2 driver. I have tried it but same error appears. After that I have rollback to 1.1 version of driver.

    Mostly error is appearing while large amount of data is processed. About 100000 records are inserted to database in batch mode.

    This job is done every day and it takes about 2 hour to finish it. Sometimes it is done without any problem but there was period when job has failed every day.

    Destination table is very large (100 mil records). I have created procedure for reducing number of records, but at least 60 mil. will need to stay in table.

     

    I will write some basic steps which are done in my application.

    1. From oracle database result set of about 100 k records are retrieved

    2. Each record is processed and then inserted into two tables in MS SQL database (the big one and to temporary storage table).

    3. When result set loop is finished temporary storage table is used to write processed data to file

    4. On the end all changes are committed in MS SQL and Oracle database

     

    Thanks again for tryng to help me.

    Wednesday, July 23, 2008 4:10 PM
  • I got this error when streaming a 300mb+ file to SQL Server 2005 using JSQLConnect JDBC driver. Our process, which was creating an index using Apache Lucene and then uploading the index file to our database, was causing this error on the SQL Server:

    A fatal error occurred while reading the input stream from the network. The session will be terminated.

     

    The main problem was that the network packet size of 4096 on SQL 2005, which supports upto 250mb. We bumped up the value to 6000 using:

    sp_configure 'show advanced option', '1'

    reconfigure

    sp_configure 'network packet size (B)', 6000

    Reconfigure

     

    Reference:

    http://support.microsoft.com/kb/q299915/

    Reference:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2260218&SiteID=1

     

     

    We got a different error upon re-running our index process. Our vendor product, Saba 5.4, uses the JNetDirect JSQLConnect JDBC driver and this turned out to be part of the problem. We were using an older version of the driver that did not support network packet size of higher than 4096. According to their latest readme file of version 5.8:

     

    "FIX: PacketSize higher then 4096 can cause DBComms Exception on Streaming Methods"

    Source: http://www.jnetdirect.com/JSQLReadme.html:

     

    We upgraded to JSQLConnect 5.8, used a network packet size of 6000 and everything worked correctly.
    Monday, November 24, 2008 8:38 PM
  • Unfortunately, we don't know anything about the JSQLConnect driver.  You will be much better off contacting them directly.

     

    Evan

    Tuesday, November 25, 2008 9:55 PM