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.
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)" );