hibernate-orm icon indicating copy to clipboard operation
hibernate-orm copied to clipboard

change getNationalizationSupport() on Sybase to use UNSUPPORTED

Open gavinking opened this issue 3 years ago • 5 comments

getNationalizationSupport() currently returns IMPLICIT for the jTDS driver. But from the comment I think it should probably return UNSUPPORTED.

WDYT @sebersole @beikov ?

gavinking avatar Jan 25 '22 10:01 gavinking

The comment meant to say that the jTDS driver doesn't support the getNString/setNString methods, but getString/setString seem to work fine since the database does support the NCHAR/NVARCHAR types. I thought that was exactly the use case for IMPLICIT, no?

beikov avatar Jan 25 '22 10:01 beikov

Well if you turn on hibernate.use_nationalized_character_data Hibernate uses setNString() / getNString(), so I think that counts as "not supported", right?

I mean, I guess we could put a catch in NVarcharJdbcType, but it's not there today.

gavinking avatar Jan 25 '22 10:01 gavinking

I thought that was exactly the use case for IMPLICIT, no?

Not exactly, no. With IMPLICIT it will use VARCHAR and CHAR for DDL generation, which on SQL Server don't (by default) accommodate Unicode.

gavinking avatar Jan 25 '22 11:01 gavinking

Hmm, then it might be better to register special JdbcTypes for NChar, NVarchar and NClob when we detect the jTDS driver.

beikov avatar Jan 25 '22 11:01 beikov

Well I'm not sure that's quite right either: at least it's quite inconsistent.

I think what you're reaching for is a new enumeration value IMPLICIT_FOR_JDBC_EXPLICIT_FOR_SQL.

gavinking avatar Jan 25 '22 11:01 gavinking