Problem:
After upgrading from WildFly 10 to 14 which means upgarde from Hibernate 5.1 to Hibernate 5.3.6 i have problem with some text values stored by SQL Server. It displays it as chinese characters instead of the actual text.
The problem is on columns with type varchar(max). Changing to column type to nvarchar(max) resolves the issue.
In management studio the text looks fine. Im a new user so i cant put here a second screenshot.
The mapping is :
@Column(name = "INTRO")
@Lob
private String intro;
Setup is:
Windows 10 or CentOS 7 in docker
Java 8
WIldFly 14
SQL Server driver 7.0.0.jre8 (but on earlier verions was the same)
SQL Server 2012 on Windows up to SQL 2017 on linux
org.hibernate.dialect.SQLServer2012Dialect
Seems like an internal change in hibernate between 5.1 and 5.3. Bug?
i could subclass this dialect and change mapping for varchar(max) to nvarchar(max) but i would rather stay on the stock dialect