Enhancement
Major
Detail
Major
Detail
Bugfix
E.g. objects with long texts in I18N HTML attributes can be saved with H2 but not loaded anymore. The following error message appears in the log:
Caused by: java.sql.SQLException: Unable to fetch knowledge item with id 'ID(99724)' of type 'I18NAttributeStorage'. at com.top_logic.knowledge.service.db2.DefaultDBAccess.fetch(DefaultDBAccess.java:101) at com.top_logic.knowledge.service.db2.DefaultDBAccess.fetchAll(DefaultDBAccess.java:201) at com.top_logic.knowledge.service.db2.MonomorphicSearch$IdOnlyResult.internalNext(MonomorphicSearch.java:565) ... 98 more Caused by: org.h2.jdbc.JdbcSQLDataException: Value too long for column "CHARACTER VARYING":"<p>A new login page is to be included in TL and made available to all applicatione... (1816529)" [22001-210] at org.h2.message.DbException.getJdbcSQLException(DbException.java:525) at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) at org.h2.message.DbException.get(DbException.java:227) at org.h2.message.DbException.getValueTooLongException(DbException.java:341) at org.h2.value.ValueLob.getStringTooLong(ValueLob.java:192) at org.h2.value.ValueClob.getString(ValueClob.java:169) at org.h2.jdbc.JdbcResultSet.getString(JdbcResultSet.java:283) at com.top_logic.basic.sql.ResultSetProxy.getString(ResultSetProxy.java:200) at com.top_logic.basic.sql.DBHelper.getClobValue(DBHelper.java:703) at com.top_logic.basic.sql.DBHelper.mapToJava(DBHelper.java:1521) at com.top_logic.dob.attr.storage.AbstractAttributeStorage.fetchObject(AbstractAttributeStorage.java:317) at com.top_logic.dob.attr.storage.DBAttributeStorageImpl.fetchValue(DBAttributeStorageImpl.java:51) at com.top_logic.dob.attr.storage.AbstractMOAttributeStorageImpl.loadValue(AbstractMOAttributeStorageImpl.java:72) at com.top_logic.knowledge.service.db2.AbstractDBKnowledgeItem.loadAttribute(AbstractDBKnowledgeItem.java:282) at com.top_logic.knowledge.service.db2.AbstractDBKnowledgeItem.loadAttributeValues(AbstractDBKnowledgeItem.java:276) at com.top_logic.knowledge.service.db2.DBKnowledgeItem.loadAttributeValues(DBKnowledgeItem.java:407) at com.top_logic.knowledge.service.db2.DBKnowledgeBase.createItem(DBKnowledgeBase.java:5108) at com.top_logic.knowledge.service.db2.DBKnowledgeBase.findOrCreateItem(DBKnowledgeBase.java:5075) at com.top_logic.knowledge.service.db2.DBKnowledgeBase.findOrCreateItem(DBKnowledgeBase.java:5043) at com.top_logic.knowledge.service.db2.DefaultDBAccess.fetch(DefaultDBAccess.java:82) ... 100 more
The corresponding command fails.
The problem affects all tables with CLOB columns.
Solution
CLOB columns are always retrieved via the Clob API, and no longer via the getString() API in the ResultSet.
Test
- test.com.top_logic.basic.sql.TestDBHelper.testClob()