Re: Open cursors
Date: Fri, 16 Jan 2004 03:03:29 GMT
Message-ID: <5wINb.78334$na.42682_at_attbi_s04>
"Steve Morrell" <Steve.Morrell_at_techprt.co.uk> wrote in message
news:3d21a3ae.0401150838.a5638_at_posting.google.com...
> Not sure if this is more a .Net question or an Oracle question but
> hey...
>
> I have an OracleConnection object in C# that I'm passing around a lot
> of other objects in sequence. This way one connection is used for all
> objects and its basically saying "perform your job on this
> connection". However, despite the fact that I'm closing the connection
> when eahc object is finished with it, the cursors which it opens in
> the database seem to stay around for quite some time, only
> disappearing when I shut the application down. How can I ensure that i
> don't get to the stage that the open_cursors variable is exceeded? Is
> there a way of saying ordering a connection to close all cursors
> associated with what it just did?
>
> Ta,
> SSM
Not familiar with C#. Why one would close the connection once each object
is done is a mystery to me. Unless there is some sort of connection pooling
then you are building up and tearing down a connection (an expansive thing
to do) all the time. If you are connection pooling then that is a different
matter. It sounds like your application is leaking cursors. The easy way
is to close each cursor when you are done. The better way is to not open the
cursor if it is already open and just reuse it. (See Oracle's application
developer's Guide)
Jim Received on Fri Jan 16 2004 - 04:03:29 CET