Servlet update execution error ORA-12518

Source: Internet
Author: User
ORA-12518: TNS: listenercouldnothandoffclientconnection this error is generally in the test database concurrency, multiple users, the background with servle

ORA-12518: TNS: listener cocould not hand off client connection this error is generally in the test database concurrency, multiple users, the background with servle

ORA-12518: TNS: listener cocould not hand off client connection

This error is generally tested for database concurrency by multiple users,

The backend executes an update using the servlet method, but the updated record is 1100. This error is always reported in the backend,

I also changed the number of connections in Oracle to 1200. However, when the number of connections reaches 356, the above error is still reported.

Solution: the connection is not closed after updating the program code. Please remember to close the connection.

Public boolean update (Department e ){
Boolean flag = true;
String updateSQL = "update department set sort =" + e. sort + "where id =" + e. getId ();
Try {
Stmt.exe cuteUpdate (updateSQL );
} Catch (Exception e1 ){
E1.printStackTrace ();
Flag = false;
}
Return flag;
}

Public boolean update (Department e ){
Boolean flag = true;
String updateSQL = "update department set sort =" + e. sort + "where id =" + e. getId ();
Try {
Stmt.exe cuteUpdate (updateSQL );
} Catch (Exception e1 ){
E1.printStackTrace ();
Flag = false;
} Finally {
Stmt. close; // remember to close
Conn. close; // remember to close
}
Return flag;
}

The previous program code was too small to detect the danger of not closing. This time, I finally tried it and spent half a day looking for other reasons, at the same time, we also discovered the little secret of oracle-concurrency Testing

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

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.