Sakai won't start on db2 due to SAKAI_PERSON_T

Description

The issue is that db2 has a limitation about the total length of all varchar types in a table. The SAKAI_PERSON_T has a bunch of 4000 length fields that exhausts this limit. Rather than mess with that hbm, which seems to have had some issue on Oracle and MySQL already (SAK-17838 ), we can adjust this in the kernel using the existing DB2Dialect9 dialect, which will make these columns clobs instead, this works perfectly fine on DB2, and won't affect the other vendors. See patch below.

2010-11-04 13:50:37,060 WARN main org.sakaiproject.springframework.orm.hibernate.AddableSessionFactoryBean - Unsuccessful schema statement: alter table SAKAI_PERSON_T add column UNIVERSITY_PROFILE_URL varchar(4000)
com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -670, SQLSTATE: 54010, SQLERRMC: 32677;SRSM32K1

Index: kernel-private/src/main/java/org/sakaiproject/springframework/orm/hibernate/dialect/db2/DB2Dialect9.java
===================================================================
— kernel-private/src/main/java/org/sakaiproject/springframework/orm/hibernate/dialect/db2/DB2Dialect9.java (revision 84297)
+++ kernel-private/src/main/java/org/sakaiproject/springframework/orm/hibernate/dialect/db2/DB2Dialect9.java (working copy)
@@ -18,7 +18,7 @@
registerColumnType( Types.VARBINARY, "LONG VARCHAR FOR BIT DATA" );
registerColumnType( Types.VARCHAR, "clob(1000000000)" );
registerColumnType( Types.VARCHAR, 1000000000, "clob($l)" );

  • registerColumnType( Types.VARCHAR, 32704, "varchar($l)" );
    + registerColumnType( Types.VARCHAR, 3999, "varchar($l)" );

Activity

Show:

Hudson CI Server November 4, 2010 at 4:49 PM

Integrated in kernel trunk #213 (See http://builds.sakaiproject.org:8080/job/kernel%20trunk/213/)
https://sakaiproject.atlassian.net/browse/KNL-611#icft=KNL-611 fix db2 startup issue b/c of SAKAI_PERSON_T table

Fixed

Details

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Created November 4, 2010 at 4:06 PM
Updated April 25, 2018 at 3:19 PM
Resolved November 4, 2010 at 4:20 PM

Flag notifications