Skip to content

Dialect is not autodetected on Sql Server 2014 with custom INT sequences #19579

Closed
@ghost

Description

See issue #16172

Dialect is not detected when a Microsoft Sql Server 2014 database is used in combination with custom sequences of INT type.
The sequence was created the following way: create sequence example as INT start with 42 increment by 1 no cache

This occurs only if jpa.database-platform is not set.
Spring Boot 2.2.2 with Java 8 and mssql-jdbc 7.4.1.jre8 is used.

Spring Boot Exception: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

After debugging I found out that hibernates SequenceInformationExtractorLegacyImpl#extractMetadata fails.
This is caused because in SequenceInformationExtractorLegacyImpl#resultSetStartValueSize() it calls resultSet.getLong()
which fails with 'java.lang.Integer' to 'java.lang.Long' exception from the Microsoft Jdbc driver (SqlServerResultSet#getLong(String))

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: stackoverflowA question that's better suited to stackoverflow.com

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions