Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-3140

JBoss Messaging does not works with MS SQL Server with MS JDBC driver 2.0 in default JDBC configuration

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 4.3.0.GA_CP08
    • 4.3.0.GA_CP07
    • Messaging
    • None
    • « Hide
      MS SQL Server 2005 or 2008
      MS JDBC drivers 2.0

    • Workaround Exists
    • Hide

      Use parameter responseBuffering to the JDBC connection URL. Default mode is "full" for the JDBC Driver version 1.2 and "adaptive" for version 2.0.

      JDBC connection URL:
      <url>jdbc:sqlserver://[host];database=[database];responseBuffering=full;</url>

      Microsoft JDBC drivers 2.0 documentation:
      http://msdn.microsoft.com/en-us/library/bb879937(SQL.90).aspx
      http://msdn.microsoft.com/en-us/library/ms378988(SQL.90).aspx

      Show
      Use parameter responseBuffering to the JDBC connection URL. Default mode is "full" for the JDBC Driver version 1.2 and "adaptive" for version 2.0. JDBC connection URL: <url>jdbc:sqlserver:// [host] ;database= [database] ;responseBuffering=full;</url> Microsoft JDBC drivers 2.0 documentation: http://msdn.microsoft.com/en-us/library/bb879937(SQL.90).aspx http://msdn.microsoft.com/en-us/library/ms378988(SQL.90).aspx
    • Low

      Over 700 tests fail on the MS SQL Server with MS JDBC driver 2.0. Problem is caused by following lines in the source code.

      Class: src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
      Method: getBytes(ResultSet rs, int columnIndex)
      Lines: 2510 - 2515.

      InputStream i = rs.getBinaryStream(columnIndex);

      if (i == null)

      { return null; }

      is = new BufferedInputStream(rs.getBinaryStream(columnIndex),
      BUFFER_SIZE);

      Should be fixed as:

      InputStream i = rs.getBinaryStream(columnIndex);

      if (i == null) { return null; }

      is = new BufferedInputStream(i, BUFFER_SIZE);

      Description:
      Problem is caused by JDBC's Adaptive buffering which is default buffering mode in the MS JDBC version 2.0 (in previous version of JDBC was ,,full buffering mode").
      Column can be accessed by the getXXXStream only once in the Adaptive buffering mode. The second attempt causes exception.
      Please see http://msdn.microsoft.com/en-us/library/bb879937.aspx

            gaohoward Howard Gao
            pslavice@redhat.com Pavel Slavicek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: