将Spring Boot版本从1.3.5升级到1.4.2后,DB2ZOS方言不起作用

阿卜杜勒·加法尔汗(Abdul Gaffar Khan)

将Spring Boot版本从1.3.5升级到1.4.2后,似乎DB2ZOS方言无法在Spring JPA的早期版本中用于分页查询。我在DB2中使用Spring JPA,当我使用分页存储库并查询第二页时会引发错误。这是生成的查询。

select
        * 
    from
        ( select
            inner2_.*,
            rownumber() over(
        order by

        order of inner2_) as rownumber_ from
            ( select
                componentd0_.comp_data_field_st_msg_id as comp_dat1_0_,
                componentd0_.comp_data_file_id as comp_dat5_0_,
                componentd0_.comp_data_file_field_id as comp_dat6_0_,
                componentd0_.component_serial_no as componen2_0_,
                componentd0_.controller_short_name as controll3_0_,
                componentd0_.message as message4_0_ 
            from
                cs_comp_data_field_st_msg componentd0_ 
            left outer join
                cs_comp_data_file componentd1_ 
                    on componentd0_.comp_data_file_id=componentd1_.comp_data_file_id 
            where
                componentd1_.comp_data_file_id=? 
            order by
                componentd0_.comp_data_field_st_msg_id asc fetch first 50 rows only ) as inner2_ ) as inner1_ 
        where
            rownumber_ > 25 
        order by
            rownumber_
o.h.engine.jdbc.spi.SqlExceptionHelper   :  DB2 SQL Error: SQLCODE=-199, SQLSTATE=42601, SQLERRMC=OF;??( [ DESC ASC NULLS RANGE CONCAT || / MICROSECONDS MICROSECOND, DRIVER=3.69.24
2016-12-26 13:41:42.886 ERROR [componentdatafiles,c50b4d59a68eb961,c50b4d59a68eb961,false] AK51602      20296 --- [io-8081-exec-75] o.h.engine.jdbc.spi.SqlExceptionHelper   :  DB2 SQL Error: SQLCODE=-516, SQLSTATE=26501, SQLERRMC=null, DRIVER=3.69.24
2016-12-26 13:41:42.887 ERROR [componentdatafiles,c50b4d59a68eb961,c50b4d59a68eb961,false] AK51602      20296 --- [io-8081-exec-75] o.h.engine.jdbc.spi.SqlExceptionHelper   :  DB2 SQL Error: SQLCODE=-514, SQLSTATE=26501, SQLERRMC=SQL_CURLH200C1, DRIVER=3.69.24
2016-12-26 13:41:42.918 DEBUG [componentdatafiles,c50b4d59a68eb961,c50b4d59a68eb961,false] AK51602      20296 --- [io-8081-exec-75] c.d.c.n.service.NonDeereXmlServiceImpl   :  Critical system error

org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:261)
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:491)
    at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
    at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.data.jpa.repository.support.CrudMethodMeta
阿卜杜勒·加法尔汗(Abdul Gaffar Khan)

org.hibernate.dialect.DB2Dialect类生成无效查询,说明其失败的原因getLimit。我已经覆盖了方言中函数并对其进行了解析。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

从版本3升级到版本4后,tinyMCE无法再拖放图像

从Spring Security 3升级到Spring Security 4后是否获得异常?

将Spring Boot 1.5升级到2 <sec:authorize>不起作用

Yii2-将Bootstrap 3升级到4

将Rails 3升级到5,作用域块语法

将android studio 1升级到2后出现错误,无法启动

从Spring 3升级到Spring 4后,HibernateTemplate出现类型不兼容错误

将我的项目从ruby 1.8.7升级到2,将Rails 3.2.3升级到4

将Eclipse Kepler SR1升级到SR2时出错?

如何将Visual Studio 2015 Update 1升级到Update 2?

Android SQLiteAssetHelper无法将只读数据库从版本1升级到2:

是否可以将Windows Server 2008 SP2上的PowerShell 3升级到更高版本?

苗条的框架:从版本3升级到版本4?

将MVC4升级到MVC5后删除的添加控制器选项

将Spring Boot从2.1.9升级到2.2后出现InaccessibleObjectException

elasticsearch-2是否兼容将kibana从版本4.5升级到5.x或6.x

Angular 2升级到RC 1

在Debian 8中将Linux内核3升级到4

将eXist-db版本2升级到4.5的索引中的问题

从休眠3升级到休眠4后,getHibernateTemplate.find()无法正常工作

从Rails 3升级到Rails 4后,CarrierWave url nil

将IPython3升级到版本5.3.0

从Spring 3.2.3升级到Spring 4后出现错误

将Unity3D项目从2019.2.12f1升级到2020.3.1f1后,Visual Studio Project中充斥着CS518错误

将D3从v4升级到v6后,轴移动到图形中心

如何将Sustainsys.Saml2从版本0.23.0升级到版本2.0.0

将项目从角度4升级到6后无法运行项目

如何在不安装Beta版本的情况下将GRUB v1升级到GRUB v2?

将项目从Vue2升级到Vue3的最佳方法