Description:
|
HSQLDB allows to specify the maximum length of LOB columns, and trying to enter a longer value than this limit should truncate the value. By default, the length of CLOB and BLOB types in HSQLDB is 16Mb, and the HSQLDialect doesn't expose the fact that this length (precision) is configurable, ignoring the specified column length and always creating a LOB column with the default precision. Fortunately, when inserting BLOBs, HSQLDB ignores the length (due to a bug in their code), but trying to insert a CLOB longer than the allowed precision will fail. While the value should simply be trimmed, there's another bug in the HSQLDB code which causes the transaction to be aborted due to a weird error triggered by the fact that there's a missing case branch for the getTruncateLength operation in a switch in their Session class.
The solution is to take into account the specified column length in the HSQLDialect.
|