matethurzo/liferay-portal — pull request #282 by laszlocsontos (2012-10-20 09:03:18+00:00)
Title: LPS-28755: Liferay Portal does not work with DB2 V10.1

Liferay Portal threw SQL0104N exception when it was used with DB2 V10, however worked normally with DB2 V9.7.

The problem was in DialectDetector: DB2's version was being checked by the equal operator (==9) and for DB2 v10 Hibernate's default dialect was chosen which is buggy.

- DialectDetector was fixed.
- Liferay's own DB2Diaclect was enhanced to use native paging SELECT clauses: FETCH FIRST n ROWS ONLY and OPTIMIZE FOR n ROWS. For more details on the two aforementioned special SQL clauses, please see DB2's official documentation here: http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.perf.doc/doc/c0055223.html
- Benchmark results shows, that using FETCH FIRST n ROWS ONLY and OPTIMIZE FOR n ROWS to query the results for the first page, improves execution time by ~30%.

For more details, please see LPS-28755 in JIRA.