java.sql.sqlexception:ora-01000: Maximum number of open cursors exceeded

Source: Internet
Author: User

In fact, the cause of this error is mainly caused by a code problem.
Ora-01000:maximum open cursors exceeded.
Indicates that a process has reached the maximum number of cursors opened.

The main reason for such errors to occur easily in Java code is that Java code is actually quite similar to opening a cursor in the database when executing conn.createstatement () and Conn.preparestatement (). In particular, if your createstatement and preparestatement are inside a loop, you will be very prone to this problem. Because the cursor is constantly open and not closed.

In general, when we write Java code, both createstatement and preparestatement should be placed outside the loop, and when these statment are used, they are closed in a timely manner. It is best to close the statment immediately after performing a executequery, executeupdate, and so on, if you do not need to use the result set (ResultSet) data.

Written on December 21, 2016, when there is a dead loop in the thread, the cursor overrun is not caused by statement.close.

java.sql.sqlexception:ora-01000: Maximum number of open cursors exceeded

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.