Working principle of database connection pool and the generation of this technology, working principle of Database Connection

Source: Internet
Author: User

Working principle of database connection pool and the generation of this technology, working principle of Database Connection

Why does this technology exist?

Database connection is a very precious and limited resource, especially on the network of multiple users. The management of databases directly affects the performance of the entire system.

1. Creating a database connection is a very time-consuming operation. If every user needs to create a database connection in the page application, the response time will be very long, which will affect the user experience.

2. The number of database connections is limited. If the management is poor and users often establish connections with the database but forget to release it, the database connection resources will be exhausted after a long running time, when there are new user operations, they will wait until the resources are released, which affects the system availability. Therefore, it is very important to manage database connection resources, especially web application systems.

Working principle of Database Connection Pool

The database connection pool is responsible for allocating, managing, and releasing database connections. It allows repeated use of only one existing database connection, rather than creating a new database connection, at the same time, it is also responsible for releasing database connections that have exceeded the maximum idle time to avoid omissions caused by the absence of database connections.

In j2ee, a certain number of pool connections will be created when the server is started, and a certain number of connections will be maintained, when you need to connect to a database, use a pool connection (idle pool connection) instead of creating a new database connection and mark it as busy, after you use the database connection, the current connection is released and marked as a space connection. If there is no idle connection during use, the server will create a new database connection according to the parameter configuration. Using this method will greatly increase the system response time and improve the running efficiency. On the other hand, to improve operation performance, database connections will release the database connections with the current idle time exceeding the maximum idle time, so as to avoid omissions due to the absence of database connections.

Related Article

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.