How to solve ORA-12516 error?

2019-09-10 13:04发布

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

1条回答
Evening l夕情丶
2楼-- · 2019-09-10 13:35

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.

查看更多
登录 后发表回答