Issue Details (XML | Word | Printable)

Key: LEP-3091
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: SE Support
Reporter: Jörg Heinicke
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
PUBLIC - Old Liferay Portal (Use Liferay Portal Standard Edition)

Several problems with DB2

Created: 23/Jun/07 07:48 AM   Updated: 26/Oct/07 06:53 PM
Component/s: None
Affects Version/s: 4.1.3, 4.2.2, 4.3.0
Fix Version/s: 4.3.0

Time Tracking:
Not Specified


 Description  « Hide
This is just a issue collector for all the occasional issues that existed with Liferay and DB2 to have something to reference to.

 All   Comments   Work Log   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Jörg Heinicke added a comment - 23/Jun/07 07:50 AM
First known issue is with Hibernate modifying Liferay's SQL statements in an inappropriate way. This is mentioned in LEP-983 and LEP-3082. Actually there is no issue, it's only a matter of selecting the appropriate Hibernate dialect as Bruno pointed out at LEP-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.

Jörg Heinicke added a comment - 23/Jun/07 08:01 AM
Up to 4.1.x including Liferay used to use LONG VARCHAR datatype for DB2 which is no longer really supported. See LEP-845 for more information on it.

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.

Jörg Heinicke added a comment - 23/Jun/07 08:05 AM
The database scripts for DB2 were incorrect by not specifying "not null" for primary keys up to 4.3 RC 2. See LEP-2232.

Michael Young added a comment - 23/Jun/07 08:43 AM
Thank you Jorg for the Summary. I am so glad that our DB2 nightmares have been resolved for the most part :).

Michael Young added a comment - 23/Jun/07 08:46 AM
Jorg,

We could actually use a Wiki Page to summarize the correct setup for DB2. Would you mind tackling this?

Jörg Heinicke added a comment - 23/Jun/07 03:14 PM
Yes, I can do this. I only want to check LEP-2780 first on Monday. If that really works the only change necessary to get Liferay working with modern DB2 is to set the Hibernate dialect.

Joerg

Sherwin Shaidaee added a comment - 26/Oct/07 11:42 AM
Do we have a Wiki page that summarizes the correct setup for DB2?

Jörg Heinicke added a comment - 26/Oct/07 06:53 PM
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.