OpenJPA
  1. OpenJPA
  2. OPENJPA-1359

SQLServer driver 2.0 works, but causes exception in SQLServerDictionary on the first connection

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.2.0, 1.2.1
    • Fix Version/s: 1.2.2
    • Component/s: jdbc
    • Labels:
      None

      Description

      The driver itself works with OpenJPA, except that the first time OpenJPA tries to obtain a connection it fails with the following exception :

      Caused by: java.lang.NumberFormatException: For input string: "JDBC"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:447)
      at java.lang.Integer.parseInt(Integer.java:497)
      at org.apache.openjpa.jdbc.sql.SQLServerDictionary.connectedConfiguration(SQLServerDictionary.java:92)
      at org.apache.openjpa.jdbc.sql.DBDictionary.decorate(DBDictionary.java:4157)
      at org.apache.openjpa.lib.jdbc.DecoratingDataSource.decorate(DecoratingDataSource.java:100)

      It seems like this method is trying to determine the diver vendor and database version, but fails with vendor/platform informations returned by this driver.

      I'm using sqljdbc4.jar and the url in the format jdbc:sqlserver:// .

      Despite the "then works" part, this initial exception seriously impairs OpenJPA usage with SQLServer in some scnarios, cause it often gets in the way of the initial schema analysis.

      This has been solved in trunk, the patch could be quite simply backported to fix it in 1.2.2 .

        Issue Links

          Activity

          Simone Gianni created issue -
          Hide
          Donald Woods added a comment -

          Already fixed in 1.2.x branch (1.2.2-SNAPSHOT) by Mike. Try using one of the nightly 1.2.2 builds to confirm the fix.

          ------------------------------------------------------------------------
          r792241 | mikedd | 2009-07-08 13:47:24 -0400 (Wed, 08 Jul 2009) | 7 lines

          OPENJPA-1029:
          Update SQLServerDictionary to handle Microsoft JDBC Driver.
          Merging changes made to trunk in revision 765841.

          Show
          Donald Woods added a comment - Already fixed in 1.2.x branch (1.2.2-SNAPSHOT) by Mike. Try using one of the nightly 1.2.2 builds to confirm the fix. ------------------------------------------------------------------------ r792241 | mikedd | 2009-07-08 13:47:24 -0400 (Wed, 08 Jul 2009) | 7 lines OPENJPA-1029 : Update SQLServerDictionary to handle Microsoft JDBC Driver. Merging changes made to trunk in revision 765841.
          Donald Woods made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Donald Woods [ drwoods ]
          Fix Version/s 1.2.2 [ 12313681 ]
          Resolution Duplicate [ 3 ]
          Donald Woods made changes -
          Link This issue duplicates OPENJPA-1029 [ OPENJPA-1029 ]
          Donald Woods made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Donald Woods
              Reporter:
              Simone Gianni
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development