gpt4 book ai didi

Java AS400 "Internal driver error"与控制台应用程序

转载 作者:行者123 更新时间:2023-11-30 03:52:48 24 4
gpt4 key购买 nike

我有一个在 AS400 上运行的 Java 1.6 控制台应用程序(这不是 Web 应用程序)。内部版本是 Hibernate 3.6.10 和 Spring 3.2.1。我们正在使用 IBM 的 Java Toolbox jt400 版本 6.6。

该应用程序使用长度超过 4700 个字符的非常大的多表查询(由 Hibernate 生成)从 DB2 数据库读取多行。此时,它正在尝试急切地初始化一个卡在主记录上的集合。 编辑:哎呀,看起来它不依赖于数据:我删除了有问题的记录,但下一条记录很快就失败了。

DEBUG Thread-0 org.hibernate.util.JDBCExceptionReporter  - could not initialize a collection: com.myapp.model.MyAppMaster.myAppOwners#36

java.sql.SQLException: Internal driver error.(908)
at java.lang.Throwable.<init>(Throwable.java:196)
at java.lang.Exception.<init>(Exception.java:41)
at java.sql.SQLException.<init>(SQLException.java:52)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:480)
at com.ibm.as400.access.SQLDataFactory.newData(SQLDataFactory.java:602)
at com.ibm.as400.access.JDServerRow.initialize(JDServerRow.java:228)
at com.ibm.as400.access.JDServerRow.<init>(JDServerRow.java:106)
at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1385)
at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:256)
at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1881)
at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1711)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at net.bull.javamelody.HibernateBatcherFactory$HibernateBatchingBatcher.prepareQueryStatement(HibernateBatcherFactory.java:71)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)
at org.hibernate.loader.Loader.doQuery(Loader.java:801)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:627)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1863)
at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:479)
at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:900)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:279)
at org.hibernate.loader.Loader.doList(Loader.java:2542)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)
[snip]

它不应该只是返回一个空结果列表吗?以前有人遇到过这个吗?这是新行为 - 该代码曾经可以工作,但这是一个新版本(但是,这些都不应改变。)

最佳答案

快速浏览 SQLDataFactory.javanewData 方法似乎表明 native 数据类型无效:

/**
Return a SQLData object corresponding to the
specific IBM i native type string.

@param nativeType An IBM i native type.
@param length Length of data (in bytes).
@param precision Precision of data.
@param scale Scale of data.
@param settings The conversion settings.
@return A SQLData object.

@exception SQLException If no valid type can be
mapped.
**/

我会更新到latest version库并查看是否可以解决问题。

关于Java AS400 "Internal driver error"与控制台应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23965584/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com