I'm using Hibernate 1.2.1 in a webapp under JDK 1.4.1, Tomcat 4.1.12, Oracle 8i and I'm experiencing this phenomenon: cursor are still open after I close the session. This is a sample servlet code:

try {
  session = sessionFactory.openSession();
  List istituti = session.find
    ("from Istituto in class it.cbim.workflow.model.Istituto"
     + " where Istituto.DirettoreScientifico = ?",
     username, Hibernate.STRING);
  if (istituti.size() > 0) {
    Istituto istituto = (Istituto) istituti.get(0);
    for (Iterator it = istituto.getLineeDiRicerca().iterator() ;
         it.hasNext() ; ) {
      LineaDiRicerca linea = (LineaDiRicerca) it.next();
      // Some code to output
    }
  }
  session.connection().commit();
  session.close();
  session = null;
}
finally {
  if (session != null) {
    session.connection().commit();
    session.close();
  }
}

After executing this code once, I have 5 open cursors in Oracle (one for the "Istituto" class and the others for the classes related to it). What's strange is that after executing this code once again, I still have 5 cursors open (and not 10). I'm using a JDBC connection to Oracle and not Tomcat's own connection pool via JNDI.

Is this behaviour normal?

TIA,

Ugo

--
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: [EMAIL PROTECTED]



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Reply via email to