Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate JPA FBSQLException结果集已关闭_Hibernate_Firebird_Jaybird - Fatal编程技术网

Hibernate JPA FBSQLException结果集已关闭

Hibernate JPA FBSQLException结果集已关闭,hibernate,firebird,jaybird,Hibernate,Firebird,Jaybird,在pgination查询期间出现此异常,我修复了此问题 ((Session)this.em.getDelegate()).connection().setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT); final Query query_ = this.em.createQuery(query).setFirstResult(indexStart); 但是现在在集合的延迟加载过程中发生了异常,那么如何再次修复它呢? 我认为问题在于Firebir

在pgination查询期间出现此异常,我修复了此问题

((Session)this.em.getDelegate()).connection().setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
final Query query_ = this.em.createQuery(query).setFirstResult(indexStart);
但是现在在集合的延迟加载过程中发生了异常,那么如何再次修复它呢? 我认为问题在于Firebird JDBC驱动程序不完全支持JPA

org.firebirdsql.jdbc.FBSQLException: The resultSet is closed
    at org.firebirdsql.jdbc.AbstractResultSet.getField(AbstractResultSet.java:687)
    at org.firebirdsql.jdbc.AbstractResultSet.getString(AbstractResultSet.java:747)
    at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$2.doExtract(VarcharTypeDescriptor.java:61)
    at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:254)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:250)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:230)
    at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:331)
    at org.hibernate.type.ComponentType.hydrate(ComponentType.java:593)
    at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:308)
    at org.hibernate.type.ManyToOneType.hydrate(ManyToOneType.java:146)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2283)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
    at org.hibernate.loader.Loader.getRow(Loader.java:1355)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
    at org.hibernate.loader.Loader.doQuery(Loader.java:829)
    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.initialize(AbstractPersistentCollection.java:369)
    at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
    at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272)
    at com.agitech.erp.bean.act.ActNSCFBean.getTabs(ActNSCFBean.java:299)

你使用哪种版本的jaybird?这听起来像是在2.2.4或2.2.3v2.2.3中修复的bug,但我只是将pom升级到2.2.4,而不更改DLL(我认为它不是必需的),但是像jpa这样的异常仍然会发生,并假定可保持的结果集为默认值。我需要调查一下。您可以在连接字符串中尝试连接属性defaultHoldableResultSet=true抱歉,但是,已经使用?defaultHoldableResultSet=true相同的ResultToubs进行了测试,我有多个数据库,事实上,将?defaultHoldableResultSet添加到正确的数据库URL可以修复所有问题