The project program runs for a period of time to complain: exceeds the maximum number of open cursors (maximum open cursors exceeded)

Source: Internet
Author: User

Before using Maven to write a small interface program, but others call a few days after the wrong, but after the restart is good, Baidu check for a long time, found that a lot of people also have this program to write their own to run a few days on the error, restart on the normal situation. Below I will share my mistake with you, hope can help you.


This is the error content:


java.sql.sqlexception:ora-00604: Recursive SQL Level 1 error ORA-01000: Maximum number of open cursors exceeded
ORA-00604: Recursive SQL Level 1 error occurred
ORA-01000: Maximum number of open cursors exceeded
ORA-00604: Recursive SQL Level 1 error occurred
ORA-01000: Maximum number of open cursors exceeded


At Oracle.jdbc.dbaccess.DBError.throwSqlException (dberror.java:134)
At Oracle.jdbc.ttc7.TTIoer.processError (ttioer.java:289)
At Oracle.jdbc.ttc7.Oall7.receive (oall7.java:573)
At Oracle.jdbc.ttc7.TTC7Protocol.doOall7 (ttc7protocol.java:1891)
At Oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe (Ttc7protocol.java:
830)
At Oracle.jdbc.driver.OracleStatement.doExecuteQuery (oraclestatement.jav
a:2391)
At Oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (oraclestateme
nt.java:2672)
At Oracle.jdbc.driver.OracleStatement.executeQuery (Oraclestatement.java:
572)
At Io.swagger.api.DbCon.QueryInstrumentData1 (dbcon.java:731)
At Io.swagger.api.GetInstrumentDataApiController.getStationPollutDataHou
Rget (getinstrumentdataapicontroller.java:102)
At Sun.reflect.GeneratedMethodAccessor352.invoke (Unknown Source)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
At Java.lang.reflect.Method.invoke (Unknown Source)
At Org.springframework.web.method.support.InvocableHandlerMethod.invoke (
invocablehandlermethod.java:215)
At Org.springframework.web.method.support.InvocableHandlerMethod.invokeF
Orrequest (invocablehandlermethod.java:132)
At ORG.SPRINGFRAMEWORK.WEB.SERVLET.MVC.METHOD.ANNOTATION.SERVLETINVOCABL
Ehandlermethod.invokeandhandle (servletinvocablehandlermethod.java:104)
At Org.springframework.web.servlet.mvc.method.annotation.RequestMappingH
Andleradapter.invokehandlemethod (requestmappinghandleradapter.java:749)
At Org.springframework.web.servlet.mvc.method.annotation.RequestMappingH
Andleradapter.handleinternal (requestmappinghandleradapter.java:689)
At Org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapt
Er.handle (abstracthandlermethodadapter.java:83)
At Org.springframework.web.servlet.DispatcherServlet.doDispatch (Dispatch
erservlet.java:938)
At Org.springframework.web.servlet.DispatcherServlet.doService (Dispatche
rservlet.java:870)
At Org.springframework.web.servlet.FrameworkServlet.processRequest (Frame
workservlet.java:961)
At Org.springframework.web.servlet.FrameworkServlet.doGet (FRAMEWORKSERVL
et.java:852)
At Javax.servlet.http.HttpServlet.service (httpservlet.java:620)
At Org.springframework.web.servlet.FrameworkServlet.service (frameworkser
vlet.java:837)
At Javax.servlet.http.HttpServlet.service (httpservlet.java:727)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Appl
icationfilterchain.java:303)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationf
ilterchain.java:208)
At Org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInterna
L (hiddenhttpmethodfilter.java:77)
At Org.springframework.web.filter.OncePerRequestFilter.doFilter (onceperr
equestfilter.java:107)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Appl
icationfilterchain.java:241)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationf
ilterchain.java:208)
At Org.apache.catalina.core.StandardWrapperValve.invoke (standardwrapperv
ALVE.JAVA:220)
At Org.apache.catalina.core.StandardContextValve.invoke (STANDARDCONTEXTV
alve.java:122)
At Org.apache.catalina.authenticator.AuthenticatorBase.invoke (Authentica
torbase.java:501)
At Org.apache.catalina.core.StandardHostValve.invoke (STANDARDHOSTVALVE.J
ava:171)
At Org.apache.catalina.valves.ErrorReportValve.invoke (ERRORREPORTVALVE.J
ava:103)
At Org.apache.catalina.core.StandardEngineValve.invoke (standardengineval
ve.java:116)
At Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.jav
a:408)
At Org.apache.coyote.http11.AbstractHttp11Processor.process (abstracthttp
11processor.java:1070)
At Org.apache.coyote.abstractprotocol$abstractconnectionhandler.process (
abstractprotocol.java:611)
At Org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun (NIOENDPO
int.java:1736)
At Org.apache.tomcat.util.net.nioendpoint$socketprocessor.run (nioendpoin
t.java:1695)
At Java.util.concurrent.ThreadPoolExecutor.runWorker (Unknown Source)
At Java.util.concurrent.threadpoolexecutor$worker.run (Unknown Source)
At Org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run (taskth
READ.JAVA:61)
At Java.lang.Thread.run (Unknown Source)
Getstationpollutdata:57 from NULL to 2017-01-16 09:59:59
Go sqlselect * tb_diagnostics where dig_station= ' and Dig_datetime > t
O_date (' 2017-01-16 09:59:59 ', ' yyyy-mm-dd hh24:mi:ss ') and Dig_datetime < To_dat

E (' 2017-01-16 10:59:59 ', ' yyyy-mm-dd hh24:mi:ss ')


From the error content, there is no grammatical errors, it said that there is a problem connecting the database, and then printed on the last side of the SQL statement is not a separate implementation of the problem. Then confused, exactly what went wrong.

There are too few cursors on the web to say what the database is. For a database, however, the cursor defaults to 50, unless you have special needs.


Well, the nonsense is not much to say, the problem is where it.


In fact, is very simple, that is, when you use the JDBC link database, Connection, ResultSet, PreparedStatement and so on are not closed or shut down a ...

Causes a program to occupy resources without releasing it, so a cumulative amount of time causes an error message that exceeds the maximum number of open cursors.


Try to be more careful next time. All of you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.