We have just changed our J2EE application in order to use a connection pool (Sun one pool), the database is Oracle 8.1.7 version and driver. We close all the connections in a finally block, and we took care about closing all the statements and resultsets. We are monitoring all the opened cursors with the v$open_cursor view, and we can see a lot of cursors opened. Most of them, come from REF Cursors from PL/SQL stored procedures and others are from simple querys from a stored procedure that return a single value. We don´t know what is happening...
Thanks in advance and sorry for my english..
-
Closing REF CURSORS FROM JDBC (1 messages)
- Posted by: Pablo Facal
- Posted on: April 21 2005 05:11 EDT
Threaded Messages (1)
- Closing REF CURSORS FROM JDBC by Stefan Zobel on April 22 2005 20:38 EDT
-
Closing REF CURSORS FROM JDBC[ Go to top ]
- Posted by: Stefan Zobel
- Posted on: April 22 2005 20:38 EDT
- in response to Pablo Facal
... the database is Oracle 8.1.7 version and driver. We close all the connections in a finally block, and we took care about closing all the statements and resultsets. We are monitoring all the opened cursors with the v$open_cursor view, and we can see a lot of cursors opened.
Hhm, that might be just an artefact of querying
v$open_cursor. Are you experiencing any problems or
are you just worried? v$open_cursor doesn't really show
you what its name suggests (currently open cursors), it's
rather something along the lines "cursors that might be
open".
A better (still not perfect) way to query open cursors
is:
select a.value, b.name
from v$mystat a, v$statname b
where a.statistic# = b.statistic#
and b.name = 'opened cursors current'
(for the current session)
and
select sum(a.value), b.name
from v$sesstat a, v$statname b
where a.statistic# = b.statistic#
and b.name = 'opened cursors current'
group by b.name
(for the database)
Best regards,
Stefan