Re: oracle leaving open cursors...
From: steve (me_at_me.com)
Date: 04/01/04
- Next message: Timo Kinnunen: "Re: JDK1.5, improved FOR loop and generics - How?!"
- Previous message: Roedy Green: "Re: peer 2 peer communication without using serversocket in tcp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 1 Apr 2004 17:16:44 +0800
On Thu, 25 Mar 2004 16:50:49 +0800, asaguden wrote
(in article <b190197d.0403250050.4231f627@posting.google.com>):
> Hi,
> We have a database driven servlet/jsp application with Oracle as backend.
> We are using oracle classes12.zip driver for our jdbc connections.
>
> At runtime, our connection pool reports that there are no
> used connections, but there are usually appr. 600 open cursors.
>
> How can that be?
> What exactly is a cursor after I hav used it (gotten data from it)?
> What resources are these cursors holding?
>
>
> When is a cursor closed (in oracle), when I close the statement,
> when I close the connection, or do I always have to close the cursor(s)
> explicitely?
>
> I am puzzled...
>
> / Peter
it depends "how" you are using the cursor, if you are calling a pl/sql
routine that returns a cursor, then the cursor is going to stay open for the
duration that the connection is open, irrelevant of the fact that you have
closed the transfer protocol.
but to decide that i would need to see exactly what sql statment you are
executing.
if it is just a straight:
"select * from emp order by 1", then what you are doing will function
correctly.
BUT if it is
"?=returnacursor();"
where ? is a cursor tied to oracle.CURSOR in your java program.
& "returnacursor()" is a pl/sql subroutine that returns a cursor,then you
need to remember that if you have opened a cursor inside the pl/sql to pass
back to the java, then you may need a routine that closes the pl/sql cursor,
resident in the same pl/sql package.
- Next message: Timo Kinnunen: "Re: JDK1.5, improved FOR loop and generics - How?!"
- Previous message: Roedy Green: "Re: peer 2 peer communication without using serversocket in tcp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|