在分页查询期间遇到此异常我用
修复了问题((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)