SQL Server Developer Center > SQL Server Forums > SQL Server Data Access > JDBC driver: infinite loop when closing ResultSet, pegged CPU
Ask a questionAsk a question
 

AnswerJDBC driver: infinite loop when closing ResultSet, pegged CPU

  • Friday, October 30, 2009 8:30 PMBrent Hill Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Every once in a while we are having a problem where closing a ResultSet never finishes, pegging the CPU at 100%. Stack trace from a thread dump looks like the following:

    "Main Thread" prio=1 tid=0x0000000040115d00 nid=0x7ea0 runnable [0x0000007fbfffc000..0x0000007fbfffd370]
           at java.lang.Throwable.fillInStackTrace(Native Method)
           at java.lang.Throwable.<init>(Throwable.java:196)
           at java.lang.Exception.<init>(Exception.java:41)
           at java.sql.SQLException.<init>(SQLException.java:40)
           at com.microsoft.sqlserver.jdbc.SQLServerException.<init>(SQLServerException.java:138)
           at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer.nextRow(SQLServerResultSet.java:4700)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLServerResultSet.java:1683)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.discardFetchBuffer(SQLServerResultSet.java:4864)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.closeInternal(SQLServerResultSet.java:555)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.close(SQLServerResultSet.java:567)

    From what I can tell from several thread dumps, it is just stuck in there constantly constructing and throwing exceptions. Has anyone seen this before? Any suggestions? It is extremely destructive to our systems because control never comes back to our application, and it chews up all our resources.

    We are running the following with sqljdbc-2.0:

    Client side:
    1. Red Hat Enterprise Linux AS release 4
    2. Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_06-b05, mixed mode)
    3. jdbc:sqlserver://;serverName=db00.xxxx;databaseName=xxxx;sendStringParametersAsUnicode=false;failoverPartner=db02.xxxx;applicationName=xxxx
    4. No failure to connect
    5. Client is remote to server
    6. There is no domain
    Server side:
    1. SQL Server 2005
    2. Server is fine
    3. Not a named instance
    4. Local system
    5. No firewall between server and client

Answers

  • Tuesday, November 03, 2009 9:45 PMEvan BasalikMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Brent,

    This behavior sounds really odd.  We have a bug that we are in the process of fixing where we get into a high CPU infinite loop when trying the close the connection.  This looks similar, but not quite the same.  This fix should be public in the near future.  If it doesn't fix this issue by proxy, then I would recommend opening up a case with our support team because trying to troubleshoot this type of issue via the Forums is going to be very hard.

    Evan

All Replies

  • Tuesday, November 03, 2009 9:45 PMEvan BasalikMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Brent,

    This behavior sounds really odd.  We have a bug that we are in the process of fixing where we get into a high CPU infinite loop when trying the close the connection.  This looks similar, but not quite the same.  This fix should be public in the near future.  If it doesn't fix this issue by proxy, then I would recommend opening up a case with our support team because trying to troubleshoot this type of issue via the Forums is going to be very hard.

    Evan