| DB2/390 Dialect throws "offset not supported error" while trying to fetch the 2nd page result. Passing parameters like PageSize limit etc from the from the front end. This only happens after upgrading to Hibernate 5 recently. Any suggestions for this? This is the current code for DB2390Dialect which throws exception. private static final AbstractLimitHandler LIMIT_HANDLER = new AbstractLimitHandler() { @Override public String processSql(String sql, RowSelection selection) { if (LimitHelper.hasFirstRow( selection )) { throw new UnsupportedOperationException( "query result offset is not supported" ); } return sql + " fetch first " + getMaxOrLimit( selection ) + " rows only"; } }; So what should be done if we want to implement the pagination for DB2 mainframe database in the latest hibernate framework? I tried to use hibernate.legacy_limit_handler property to set as true. PFB the part of application.yml file. hibernate: ddl-auto: validate naming-strategy: org.hibernate.cfg.EJB3NamingStrategy properties: hibernate.cache.use_second_level_cache: false hibernate.cache.use_query_cache: false hibernate.generate_statistics: false hibernate.dialect: org.hibernate.dialect.DB2390Dialect hibernate.legacy_limit_handler: true WARN [com.service.xxxService] - <query result offset is not supported> java.lang.UnsupportedOperationException: query result offset is not supported at org.hibernate.dialect.DB2390Dialect$1.processSql(DB2390Dialect.java:27) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1893) This is the error I get whenever try for getting the second page result. This is happening only after the hibernate 5.1 upgrade. Kindly look into this and provide an update. |