The role of connection pooling in JSP development process

Source: Internet
Author: User
Tags connection pooling
In today's web programming project using Java, security and the speed of the system are all issues that every developer needs to consider. Especially in the Java Mall development and the development of JSP Mall, the use of connection pool and configuration is more important, why this is said, below our developers to take you in-depth understanding of the Java development process of the connection pool.
Each read and write operation of the database requires a connection, and its access flow is probably as follows:
Applying the data layer to datasource request a database connection
DataSource using database driver to open a database connection
Create a database connection, open a TCP socket
Apply a read/write database
If the connection is no longer needed, close the connection
Close socket
It is easy to infer that opening/closing a database connection is a costly operation. PostgreSQL produces a separate OS process for each client connection, so a high frequency of open/close database connections can increase the pressure on the database management system.
The most obvious reasons for reusing database connections are:
-Reduce OS I/O overhead of creating/destroying TCP connections for application and database management systems
-Reduce JVM Object garbage

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.