Subject | RE: [Firebird-Java] Firebird-Hibernate problem - result set is already closed |
---|---|
Author | Rick Debay |
Post date | 2006-02-03T18:50:11Z |
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html
"A ResultSet object is automatically closed when the Statement object
that generated it is closed, re-executed, or used to retrieve the next
result from a sequence of multiple results."
I think you wrote in a previous post that you loop on a ResultSet,
performing various updates inside the loop.
If so, older versions of Jaybird didn't follow the requirement to close
the ResultSet, and that may be your issue.
-----Original Message-----
From: Firebird-Java@yahoogroups.com
[mailto:Firebird-Java@yahoogroups.com] On Behalf Of dhay@...
Sent: Friday, February 03, 2006 1:05 PM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Firebird-Hibernate problem - result set is
already closed
Hi Roman,
Really under the gun here....got everything checked in for my part of
the project, only to find that it breaks a different part of our
Hibernate use.
If we change back to using firebirdsql-full.jar rather than the new
jaybird-full.jar everything works fine, however.
This is the exception we are getting. Any ideas?
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation:
could n
ot initialize a collection:
[com.lexmark.workflow.framework.domain.printergroup.
PrinterGroup.deployments#688128]; uncategorized SQLException for SQL
[select dep loyment0_.PGROUP_ID as PGROUP2_1_, deployment0_.ID as ID1_,
deployment0_.SOLN as SOLN1_, deployment0_.ID as ID0_ from
PGSOLUTIONDEPLOYMENT deployment0_ where de ployment0_.PGROUP_ID=?]; SQL
state [HY000]; error code [0]; The result set is cl osed; nested
exception is org.firebirdsql.jdbc.FBSQLException: The result set is
closed
org.firebirdsql.jdbc.FBSQLException: The result set is closed
at
org.firebirdsql.jdbc.FBResultSet.checkCursorMove(FBResultSet.java:217
)
at org.firebirdsql.jdbc.FBResultSet.next(FBResultSet.java:249)
at
org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.
java:152)
at org.hibernate.loader.Loader.doQuery(Loader.java:408)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:218)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1434)
at
org.hibernate.loader.collection.OneToManyLoader.initialize(OneToManyL
oader.java:111)
at
org.hibernate.persister.collection.AbstractCollectionPersister.initia
lize(AbstractCollectionPersister.java:488)
at
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onIn
itializeCollection(DefaultInitializeCollectionEventListener.java:60)
at
org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:
1430)
at
org.hibernate.collection.AbstractPersistentCollection.forceInitializa
tion(AbstractPersistentCollection.java:280)
at
org.hibernate.engine.PersistenceContext.initializeNonLazyCollections(
PersistenceContext.java:796)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:223)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
at
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.ja
va:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at
org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate
(HibernateTemplate.java:766)
at
org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
eTemplate.java:315)
at
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTe
mplate.java:757)
at
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTe
mplate.java:753)
cheers,
David
x54680
Yahoo! Groups Links
"A ResultSet object is automatically closed when the Statement object
that generated it is closed, re-executed, or used to retrieve the next
result from a sequence of multiple results."
I think you wrote in a previous post that you loop on a ResultSet,
performing various updates inside the loop.
If so, older versions of Jaybird didn't follow the requirement to close
the ResultSet, and that may be your issue.
-----Original Message-----
From: Firebird-Java@yahoogroups.com
[mailto:Firebird-Java@yahoogroups.com] On Behalf Of dhay@...
Sent: Friday, February 03, 2006 1:05 PM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Firebird-Hibernate problem - result set is
already closed
Hi Roman,
Really under the gun here....got everything checked in for my part of
the project, only to find that it breaks a different part of our
Hibernate use.
If we change back to using firebirdsql-full.jar rather than the new
jaybird-full.jar everything works fine, however.
This is the exception we are getting. Any ideas?
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation:
could n
ot initialize a collection:
[com.lexmark.workflow.framework.domain.printergroup.
PrinterGroup.deployments#688128]; uncategorized SQLException for SQL
[select dep loyment0_.PGROUP_ID as PGROUP2_1_, deployment0_.ID as ID1_,
deployment0_.SOLN as SOLN1_, deployment0_.ID as ID0_ from
PGSOLUTIONDEPLOYMENT deployment0_ where de ployment0_.PGROUP_ID=?]; SQL
state [HY000]; error code [0]; The result set is cl osed; nested
exception is org.firebirdsql.jdbc.FBSQLException: The result set is
closed
org.firebirdsql.jdbc.FBSQLException: The result set is closed
at
org.firebirdsql.jdbc.FBResultSet.checkCursorMove(FBResultSet.java:217
)
at org.firebirdsql.jdbc.FBResultSet.next(FBResultSet.java:249)
at
org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.
java:152)
at org.hibernate.loader.Loader.doQuery(Loader.java:408)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:218)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1434)
at
org.hibernate.loader.collection.OneToManyLoader.initialize(OneToManyL
oader.java:111)
at
org.hibernate.persister.collection.AbstractCollectionPersister.initia
lize(AbstractCollectionPersister.java:488)
at
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onIn
itializeCollection(DefaultInitializeCollectionEventListener.java:60)
at
org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:
1430)
at
org.hibernate.collection.AbstractPersistentCollection.forceInitializa
tion(AbstractPersistentCollection.java:280)
at
org.hibernate.engine.PersistenceContext.initializeNonLazyCollections(
PersistenceContext.java:796)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:223)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
at
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.ja
va:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at
org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate
(HibernateTemplate.java:766)
at
org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
eTemplate.java:315)
at
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTe
mplate.java:757)
at
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTe
mplate.java:753)
cheers,
David
x54680
Yahoo! Groups Links