Open cursors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Morrell

    Open cursors

    Not sure if this is more a .Net question or an Oracle question but
    hey...

    I have an OracleConnectio n 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
  • Jim Kennedy

    #2
    Re: Open cursors


    "Steve Morrell" <Steve.Morrell@ techprt.co.ukwr ote in message
    news:3d21a3ae.0 401150838.a5638 @posting.google .com...
    Not sure if this is more a .Net question or an Oracle question but
    hey...
    >
    I have an OracleConnectio n 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


    Comment

    Working...