0 Replies Latest reply on Jun 13, 2011 1:26 PM by Cristian Mastrantono

    Destroying connection that is not valid, due to the following exception [com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset]

    Cristian Mastrantono Newbie

      Hi everyone,

      I'm facing the following problem in a Server runing Linux with JBoss AS 4.2.2, JRE 1.6, and MSSQL Server 2005 with JDBC 2.0 (sqljdbc4.jar).

      The thing is: on friday morning I started up the server and everything worked fine ... next, from Friday at 6pm to Saturday at 8am nobody has used the system.

      Then on Saturday at 8:05 got the following warning lines every time I tried to do something in my application. While it seems that everything works, after a few days the system starts to decrease their performance and malfunction, so I want to know why it might happen these warnings.

      I have tried to find a solution to this problem in several places but I'm not succeeding. That's why I'm writing my problem here...

      Hope somebody can help me!

      Thanks in advance and best regards!

      Cristian.

       

      This is the "error" log.

      2011-06-11 08:05:29,680 WARN [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Destroying connection that is not valid, due to the following exception: ConnectionID:2941
      com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1352)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1339)
                at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:1654)
                at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:3694)
                at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:5022)
                at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:773)
                at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:676)
                at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
                at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
                at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
                at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:649)
                at org.jboss.resource.adapter.jdbc.CheckValidConnectionSQL.isValidConnection(CheckValidConnectionSQL.java:58)
                at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:435)
                at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkValid(BaseWrapperManagedConnection.java:231)
                at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.matchManagedConnections(LocalManagedConnectionFactory.java:200)
                at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:211)
                at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:538)
                at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
                at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
                at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
                at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
                at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
                at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
                at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
                at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
                at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                at org.hibernate.loader.Loader.doQuery(Loader.java:673)
                at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                at org.hibernate.loader.Loader.doList(Loader.java:2220)
      


      And this is my mssql-ds.xml

      <local-tx-datasource>
        <jndi-name>jdbc/bpmsdb</jndi-name>
                <connection-url>jdbc:sqlserver://ipaddress:1433;DatabaseName=BPMS</connection-url>
        <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
        <user-name>user</user-name>
        <password>pwd</password>
                <min-pool-size>5</min-pool-size>
                <max-pool-size>50</max-pool-size>
                <exception-sorter-class-name>
                          org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
                </exception-sorter-class-name>
                <metadata>
                 <type-mapping>MS SQLSERVER2000</type-mapping>
                </metadata>
                 <new-connection-sql>select 1</new-connection-sql>
                 <check-valid-connection-sql>select 1</check-valid-connection-sql> 
                 <idle-timeout-minutes>5</idle-timeout-minutes>           
       </local-tx-datasource>