|
Up to 4.1.x including Liferay used to use LONG VARCHAR datatype for DB2 which is no longer really supported. See
From 4.2 Liferay uses CLOB in those cases. Another connected issue is the kind of statements Liferay uses to search for including null checks: lower(Group_.name) LIKE ? OR ? IS NULL These don't work with DB2 since it knows no generic null check. It insists on datatype information for the second parameter like in: lower(Group_.name) LIKE ? OR CAST(? AS VARCHAR(75)) IS NULL To get it working in Liferay have a look into portal.properties and there for the following two keys for DB2: custom.sql.function.isnull=CAST(? AS VARCHAR(32672)) IS NULL custom.sql.function.isnotnull=CAST(? AS VARCHAR(32672)) IS NOT NULL Activate them in your customized portal.properties, e.g. portal-ext.properties. The database scripts for DB2 were incorrect by not specifying "not null" for primary keys up to 4.3 RC 2. See
Thank you Jorg for the Summary. I am so glad that our DB2 nightmares have been resolved for the most part :).
Jorg,
We could actually use a Wiki Page to summarize the correct setup for DB2. Would you mind tackling this? Yes, I can do this. I only want to check
Joerg Do we have a Wiki page that summarizes the correct setup for DB2?
The only necessary change in 4.3.0 was to set the correct Hibernate dialect as stated above. That's why I refrained from setting up a wiki page since it's pretty much useless.
|
|||||||||||||||||||||||||||||||||||||||||||||
LEP-983andLEP-3082. Actually there is no issue, it's only a matter of selecting the appropriate Hibernate dialect as Bruno pointed out atLEP-983. Liferay's DynamicDialect relies on Hibernate's DialectFactory which has insufficient logic to retrieve the correct dialect, it always chooses org.hibernate.dialect.DB2Dialect while it should be org.hibernate.dialect.DB2400Dialect for newer versions of DB2 using the universal driver.