Hi. I'm afraid I found a bug in the cursors release. It appears everytime I execute several queries (more than 1000) in the same session.
I'm working with Hibernate 2.0.3, using jdbc driver for Oracle 8.1.7


My code is something like this:

Session session = factory.openSession();
Query query = session.getNamedQuery("...");
for (int pos = 0;pos++; pos < 3000)
{
        query.setParameters(.....);
        Iterator it = query.list().iterator();
        while (it.hasNext())
        {
                //make something with it.next()
        }
}
session.close();

It works fine, but as you can see, the list generated by the query is innecesary. I need only the iterator.

If I change my code, getting de iterator from the query:
        Iterator it = query.iterate();

I get this error:

java.sql.SQLException: ORA-01000: n�mero m�ximo de cursores abiertos excedido

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:118)
at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:466)
at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:413)
at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:432)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:182)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:165)
at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:608)
at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:489)
at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache$2.run(GooGooStatementCache.java:317)
at com.mchange.v2.async.CarefulRunnableQueue$TaskThread.run(CarefulRunnableQueue.java:145)


Thanks!

German






------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to