Manuel Mall (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-13805 (
https://hibernate.atlassian.net/browse/HHH-13805?atlOrigin=eyJpIjoiMTMzYT...
)
Re: Dialect is not autodetected on Sql Server 2014 with custom INT sequences (
https://hibernate.atlassian.net/browse/HHH-13805?atlOrigin=eyJpIjoiMTMzYT...
)
I don’t agree with the assessment that this is a bug in the Microsoft JDBC driver. There
is no requirement for a driver to automatically cast results. The problem is that SQL
Server sequences are typed and can be of any integer type (
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-sequence-tra...
). That is reflected in the types of the values returned when querying the schema
(INFORMATION_SCHEMA.SEQUENCES). The type of value returned by the columns holding the min,
max, and start sequence values reflects the type of the sequence as they are of type
sql_variant. However, Hibernate assumes it always returns a Long which is an incorrect
assumption. I recently had to deal with the issue and wrote a small custom dialect that
works around the issue.
See also:
https://discourse.hibernate.org/t/java-lang-classcastexception-java-math-...
and
https://discourse.hibernate.org/t/sql-server-could-not-fetch-the-sequence...
(
https://hibernate.atlassian.net/browse/HHH-13805#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-13805#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100125- sha1:29f7b81 )