Uploaded image for project: 'JITL - JobScheduler Integrated Template Library'
  1. JITL - JobScheduler Integrated Template Library
  2. JITL-337

InventoryPlugin: "MappingException: No Dialect mapping for JDBC type: -9" occurs when using native MS SQL Driver

    XMLWordPrintable

Details

    • Fix
    • Status: Released (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.11.1
    • 1.11.2, 1.12
    • None

    Description

      Current Situation
      When using a native MS SQL JDBC Driver an error occurs with the Exception: MappingException: No Dialect mapping for JDBC type: -9

      However, the error does not occur when using the deployed JTDS Driver.

      11 08:19:45.855 com.sos.jitl.inventory.plugins.InitializeInventoryInstancePlugin [ERROR] - javax.persistence.PersistenceException: org.hibernate.MappingException: No Dialect mapping for JDBC type: -9
      javax.persistence.PersistenceException: org.hibernate.MappingException: No Dialect mapping for JDBC type: -9
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155)
      	at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1419)
      	at org.hibernate.Query.getResultList(Query.java:427)
      	at com.sos.jitl.inventory.data.ProcessInitialInventoryUtil.getDbVersion(ProcessInitialInventoryUtil.java:352)
      

      Desired Behavior
      No error should occur when using native drivers.

      Note

      In the initial processing part of the InventoryPlugin the version of the DBMS is determined via a native SQL query select @@version.
      However, the native function @@version has a return value of type NVARCHAR.

      The deployed JTDS driver internally maps the return value to the generally known type VARCHAR properly before hibernate maps this type to the proper java type (String).
      The MS SQL driver does not map NVARCHAR to VARCHAR and the currently used hibernate version is not able to map NVARCHAR to the correct java type.

      Attachments

        Issue Links

          Activity

            People

              sp Santiago Aucejo Petzoldt
              sp Santiago Aucejo Petzoldt
              Uwe Risse Uwe Risse
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: