Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: jdbc cursor problem
Generally speaking, this is a programming error. It's good practice to close
the result set AND the statement as soon as you are done with them.
Every time I have seen this error, it has ended up being the programmer not closing the result set and statement when they are done with them, so when the method that creates the statement/result set is executed again it acutally creates another cursor - it doesn't reuse to one that is already open - soon you will hit the limit.
max open cursor = 500 is a big number. That is 500 open cursors per session!
Hope this helps!!
Ron Bogdanoff
Sr. Software Engineer
Digital Market Inc.
408-720-7422 x 146
In article <F2xp0L.AAy_at_twisto.im.hou.compaq.com>,
"ron bisaccia" <ron.bisaccia_at_compaq.com> wrote:
> Please help.
>
> We are unable to avoid a "maximum open cursors exceeded" problem when using
> JDBC prepared statements to Oracle 8 Enterprise. The problem manifests
> itself in the following ways:
>
> (1) The exception is thrown after running 5 or 6 transactions using our
> server object that contains the database accesses.
> (2) Using a JDBC-ODBC bridge, we need to close the prepared statements in
> order not to get the exception. If we simply close the result sets, the
> exception is thrown.
> (3) Using the Oracle JDBC thin driver, closing the prepared statements
> doesn't help either. The exception is always thrown.
> (4) Discarding the database connection between transactions closes the
> cursors and avoids the problem.
> (5) In both cases, if we query the database using (for example) select
> count(*) from v$_open_cursor in SQL+, we are told that there is only one
> open cursor, even immediately before and immediately after the exception is
> thrown.
> (6) We have set max cursors to 500, and our code opens substantially fewer
> in each transaction.
>
> Has anyone else experienced these problems? Are there any diagnostics that
> will help us to pinpoint the problem, assuming it is in our code or in our
> settings for the database?
>
> Thanks,
>
> Ron
>
>
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Nov 24 1998 - 17:11:45 CST
![]() |
![]() |