Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: To many cursors ? JDBC
> i ve got a problem with too many open cursors. I`m using the oracle 9.0.2
> jdbc driver. I create a stament, execute it and then I close it , then I
> close the connection. But after a wile there are too many open cursor. I
> think, if my java brakes down or something else happens, the garbage
> collector destroys the objects but the cursor will stay open???
> Is there a way to find all open cusors and close them in the finally
method
> of my object ? And what happens if the connection brakes down and the
cursor
> are still open ?
Dont forget that you also have to close result sets... not just statements. Plus.. have an extra look at your exception handling. If an exception gets thrown and caught elsewhere.. will still all statements / result sets get closed properly ? It easily happens that you overlook something and a statement or result set gets hanging around... still open.
Also, in Oracle, have a look at this table to see the open cursors that you currently have in your instance: SYS.V_$OPEN_CURSOR
If you find your code is "clean" and all the cursors that there are open really need to be open, then you can increase the instance's "open_cursors" parameter. This however should be the last weapon to pull.... only if anything else fails. Received on Thu Aug 05 2004 - 05:00:22 CDT
![]() |
![]() |