How database connection pooling works and how this technology is generated

Source: Internet
Author: User
Tags connection pooling

Why is this technology needed?

Database connection is a very precious and limited resource, especially in multi-user network, the management of database directly affects the performance of the whole system.

The establishment of a database connection is a very time-consuming operation, in the page application if each user needs to create a database connection, the response time will be very long, will affect the user experience

Second, the database connection number is limited, if the management is not good users often establish a connection with the database and forget to release, then run for a long time, the database connection resources will be exhausted, when there are new user actions will wait until the resources are released, which has an impact on the availability of the system. Therefore, it is very important to manage database connection resources, especially the Web application system.

How database connection pooling works

The database connection pool is responsible for allocating, managing, and freeing the database connection, which allows you to reuse only one existing database connection instead of creating a new database connection, and it is also responsible for freeing up database connections that are longer than the maximum idle time and avoiding omissions due to lack of database connectivity.

In Java EE, the server starts up with a certain number of pooled connections and maintains not less than this number of connections, when the user needs a database connection first using pooled connections (free pooled connections) instead of creating a new database connection and marking it as busy. When the user finishes using the database connection, the current connection is freed and marked as a spatial connection. If there is no idle connection, the server will create a new database connection according to the configuration of the parameters, which will greatly improve the response time of the system and improve the operation efficiency. On the other hand, for improved operational performance, database connectivity frees up database connections that are currently idle for more than the maximum idle time, avoiding omissions that do not release database connections.

How database connection pooling works and how this technology is generated

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.