Hi all,
should I have to close or flush anything when using iterate on Query interface (to clean resources on database ) ?
I use intensively this method on a table (in the same hibernate session) and obtain an exception with maximum open cursors exceeded after several minutes of execution.
I think I mistake using correctly this API, but I do not know where.
Greetings
Alain
Hibernate version:
Hibernate 2.1.8
Mapping documents:
Code between sessionFactory.openSession() and session.close():
public Iterator iterateOnQuery(String pQuery, Map pParams)
throws DatabaseException {
try {
Query query = currentSession().getNamedQuery(pQuery);
for (Iterator iParam = pParams.keySet().iterator(); iParam
.hasNext();) {
String key = (String) iParam.next();
query.setString(key, (String) pParams.get(key));
}
return query.iterate();
} catch (HibernateException hExc) {
throw new DatabaseException(DatabaseException.CODE.DATABASE_QUERY,
DatabaseException.RAISON.QUERY_SELECT_FAILED, hExc,
new Object[] {
pQuery
});
}
}
I do not close session on every call since I use a single session to perform a batch.
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Oracle 8.1.7.0
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|