如何解决ORA-12516错误? [英] How to solve ORA-12516 error?

查看:755
本文介绍了如何解决ORA-12516错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用oracle数据库10g express版本。最近我经常面临ORA-12516错误。它说 -
java.sql.SQLException:监听器拒绝连接与以下错误:
ORA-12516,TNS:监听器找不到可用的处理程序与匹配协议栈
连接客户端使用的描述符是:
//127.0.0.1:1521/XE



就我而言,当用户没有显示该错误时,关闭变量,如StatementResultset,并打开了很多。
每当我在函数中创建任何Statement或ResultSet类型变量时,我使用这个函数 - http://paste.ubuntu.com/7902053/ 关闭这些变量。我没有关闭那些被声明的函数的最后一个块中的这些变量。相反,我调用此函数(close_calls(..))来关闭这些变量,并将它们作为参数在函数close_calls(..)中发送。例如,我在上面给出了17和23行中给出的功能 - http://paste.ubuntu。 com / 7902114 /



但这个错误仍然显示在控制台中。 close_call(...)不工作?我如何摆脱这个错误?我得到了从这里关闭这些变量的想法--- 关闭Java中的数据库连接

解决方案

您的代码泄漏连接(不是游标或语句)。



您也必须关闭连接,而不仅仅是声明和结果集 - 就像您链接到的问题的答案一样。


I am using oracle database 10g express edition. Recently I am facing ORA-12516 error frequently. It says -- "java.sql.SQLException: Listener refused the connection with the following error: ORA-12516, TNS:listener could not find available handler with matching protocol stack The Connection descriptor used by the client was: //127.0.0.1:1521/XE"

As far as I am concerned this error is shown when user doesn't close variables like "Statement" "Resultset" and opens a lot of them. Every time I created any "Statement" or "ResultSet" type variables in a function I used this function -- http://paste.ubuntu.com/7902053/ to close those variables. I didn't close those variables in a final block of the function inside which those were declared. Instead I called this function (close_calls(..)) to close those variables and sent them as parameters inside the function close_calls(..). For example I called the function given above in no 17 and 23 line here -- http://paste.ubuntu.com/7902114/

But this error is still shown in the console. Is close_call(...) not working ? How can I get rid of this error ? I got the idea of closing those variables from here --- Closing Database Connections in Java

解决方案

Your code is leaking connections (not cursors or statements).

You've got to close the connections too, not only the statements and result sets - just as suggested by answer of that question you linked to.

这篇关于如何解决ORA-12516错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆