ERROR:maximum cursor open,ORA-01000

作者使用oracle8.1.7和tomcat 4.0.4服务器,运行应用保存特定表单时出现最大游标打开错误,Oracle无响应需重启服务器。问题表现为ORA - 1000错误,增加open_cursors参数无法解决。解决办法是显式关闭所有游标,可在finally块中操作,还可查询V$OPEN_CURSOR视图确定未关闭游标。
JDBC 技术论坛

来自: yadav_kamal@hotmail.com 15-Jul-03 08:07
主题: ERROR:maximum cursor open


ERROR:maximum cursor open 




Hi All

I am working with oracle8.1.7 with tomcat 4.0.4 server .when i run application and save particular form then after save
i am getting maximum cursor open error and oracle is not respond then server might be restart again for application.
pls reply as soon as.

Thanks
Kamal yadav




来自: Oracle, kiranmai Lang 15-Jul-03 17:10
主题: Re : ERROR:maximum cursor open

Problem Description
-------------------

You have a JDBC application which runs for several hours. It then
returns the following error:

ORA-1000 Maximum open cursors exceeded

The open_cursors parameter in init.ora is currently set to a number in
excess of the maximum number of cursors you expect your application
to have open at any one time. Increasing open_cursors extends the
period of time before failure, but does not resolve the issue.


Solution Description
--------------------

Typically, in Java, when an object goes out of scope, it is automatically garbage collected, but the Java specification does not place any specific requirements on the JVM regarding when (or even if) this will occur for any particular object. Therefore, do not rely on finalizers to close your cursors.

Explicity close all cursors ResultSet.close(), Statement.close(), and
PreparedStatement.close() when you no longer need the cursor. This ensures that the corresponding server-side cursors are closed, preventing the ORA-1000 error. Be sure to close these JDBC objects within the scope that they were created. Closing these objects in a finally{} block is recommended, however, DO NOT rely upon a finalize() method because a finalize() method is never guaranteed to run by the JVM!

A common error occurs when CallableStatement is used to call a PL/SQL procedure that returns a REF CURSOR. If you do not close the corresponding ResultSet object,a cursor will be left open on the server.

You can query the SQL_TEXT column in V$OPEN_CURSOR view from the schema to determine which cursors are not being closed. For example:

select   sql_text   from   v$open_cursor;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-84232/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/35489/viewspace-84232/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值