Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: jdbc thin driver raises: ORA-01000: maximum open cursors exceeded

Re: jdbc thin driver raises: ORA-01000: maximum open cursors exceeded

From: <jeanch_at_my-deja.com>
Date: 2000/07/12
Message-ID: <8kh8ro$380$1@nnrp1.deja.com>#1/1

In article <8jhg3h$8il$1_at_crusher.de.colt.net>,   "André Hartmann" <Andre.Hartmann_at_pace.de> wrote:
> Okay,
>
> thanx.... there are two resulting questios on that ....
>
> (1) As a normal DB User ... how can I increase the value of the
 open_cursor
> parameter during application runtime using the connection that I
 have ?? I
> am not the DBA so all I have are ordinary user privileges (role
 RESOURCE).
>
> (2) How to close cursors via jdbc ?? Actually I am using a connection
 pool
> with a number of long lasting connections that are reused by java
 processes
> again and again. One a process is done, it hands the connection back
 to the
> pool. In this case I would love to release all cursors if I knew how.
 COMMIT
> doesnt help. A connection is being committed when it is handed back
 but the
> ORA-01000 keeps being thrown.
>
> AH
> :)
>
> Sybrand Bakker schrieb in Nachricht
> <962297072.4119.2.pluto.d4ee154e_at_news.demon.nl>...
> >This depends on the value of the open_cursor parameter. The default
 is 50
> >which is usually way too low.
> >500 is more like it.
> >A common problem in java applications is programmers don't close
 their
> >cursors. This eventually results in the error you are seeing.
> >
> >Regards,
> >
> >Sybrand Bakker, Oracle DBA
> >
> >"André Hartmann" <Andre.Hartmann_at_pace.de> wrote in message
> >news:8jfisj$cda$1_at_crusher.de.colt.net...
> >> Hi there,
> >>
> >> my jdbc thin driver comes up with a "ORA-01000: maximum open
 cursors
> >> exceeded" message after a connection has been opened and several
 statements
> >> have been processed. How do I work around that ?? Surely I could
 increase
> >> the number of max. cursors allowed but this would shift the
 problem to a
> >> later point of time only... so, how to really handle it ?
> >>
> >> If this is rather a java question... sorry about it. Thanx in
 advance,
> >> your's
> >>
> >> André
> >> :)
> >>
> >>

Andre,
Please don't underestimate the fact that some resource might be left unused
when cursors are not closed indeed released properly. I suggest you investigate thoroughly the problem before leaping for the easy option increasing the Max No of cursor. If you're using cursor in your code ensure that they are closed even when an exception occurs. Dito if you're using dynamic SQL;
If indeed everything is OK in your code then by all means increase or ask your DBA to increase the open_cursor parameter.

Cheers
JC
> >>
> >
> >
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Jul 12 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US