ORA-01000 maximum open cursors exceeded

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ORA-01000 maximum open cursors exceeded

Ted Shen-3
I am sending a lot of queries to an Oracle database and partway through the
program I get an error message:

'ORA-01000 maximum open cursors exceeded'

Is there a way to explicitly close the open cursors after each query that my
program submits?

Thanks.

Ted


Reply | Threaded
Open this post in threaded view
|

Re: ORA-01000 maximum open cursors exceeded

Christopher J. Demers
"Ted Shen" <[hidden email]> wrote in message
news:400412d8$[hidden email]...
> I am sending a lot of queries to an Oracle database and partway through
the
> program I get an error message:
>
> 'ORA-01000 maximum open cursors exceeded'
>
> Is there a way to explicitly close the open cursors after each query that
my
> program submits?

You can manually close the result sets when you are done with them by
sending the message close.  Additionally you can force a garbage collection
via:
MemoryManager current collectGarbage; administerLastRites.
That can be sent multiple times if finalization tends to produce additional
garbage.  Oracle seems to have a lower limit than other systems hence it is
quicker to complain.  You can do a google search of this group to found out
about additional Oracle issues.  However I think most issues have been
mitigated in recent patches.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: ORA-01000 maximum open cursors exceeded

Dmitry Zamotkin-5
In reply to this post by Ted Shen-3
Hello Ted,

> I am sending a lot of queries to an Oracle database and partway
> through the
> program I get an error message:
>
> 'ORA-01000 maximum open cursors exceeded'
>
> Is there a way to explicitly close the open cursors after each
> query that my
> program submits?
>

I suspect you dont use parametrization in SQL queries:
http://object-arts.com/Lib/EducationCentre4/htm/preparingsqlforlaterexecution.htm

Otherwise you should explicitly close DBStatement (and cursor) by method
#free.

--
Dmitry Zamotkin


Reply | Threaded
Open this post in threaded view
|

Re: ORA-01000 maximum open cursors exceeded

Ted Shen-3
In reply to this post by Ted Shen-3
Thanks for the solutions.  Sending #close to the dbResultSet didn't
eliminate the error message, but garbage collection and sending #free to the
dbStatement worked.

Ted


"Ted Shen" <[hidden email]> wrote in message
news:400412d8$[hidden email]...
> I am sending a lot of queries to an Oracle database and partway through
the
> program I get an error message:
>
> 'ORA-01000 maximum open cursors exceeded'
>
> Is there a way to explicitly close the open cursors after each query that
my
> program submits?
>
> Thanks.
>
> Ted
>
>