Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3306246
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:15:57+00:00 2026-05-17T21:15:57+00:00

I just wanted to know the concept of database connection pooling and how it

  • 0

I just wanted to know the concept of database connection pooling and how it is achieved.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:15:58+00:00Added an answer on May 17, 2026 at 9:15 pm

    Database connection pooling is a method used to keep database connections open so they can be reused by others.

    Typically, opening a database connection is an expensive operation, especially if the database is remote. You have to open up network sessions, authenticate, have authorisation checked, and so on. Pooling keeps the connections active so that, when a connection is later requested, one of the active ones is used in preference to having to create another one.

    Refer to the following diagram for the next few paragraphs:

      +---------+
      |         |
      | Clients |
    +---------+ |
    |         |-+  (1) +------+ (3) +----------+
    | Clients | ==#==> | Open | ==> | RealOpen |
    |         |   |    +------+     +----------+
    +---------+   |       ^
                  |       |(2)
                  |    /------\     +---------+ (6) +-----------+
                  |    | Pool | --> | Cleaner | ==> | RealClose |
                  |    \------/     +---------+     +-----------+
              (4) |       ^
                  |       |(5)
                  |    +-------+
                  #==> | Close |
                       +-------+
    

    In it’s simplest form, it’s just an API call (1) to an Open API call which is similar to the "real" one, RealOpen. This first checks the pool for a suitable connection (2) and, if one is available, that’s given to the client. Otherwise a new one is created (3) and given to the client.

    A "suitable connection" is just one that already has access to the database using the correct information (such as database instance, credentials, and possibly other things).

    Similarly, there’s a Close API call (4) which doesn’t actually call the real RealClose, rather it puts the connection back into the pool (5) for later use. At some point, connections in the pool may be actually closed (6). This could be done by a thread that continuously monitors the pool and calls RealClose if they are old enough or certain other conditions are met.

    That’s a pretty simplistic explanation. Real implementations may be arbitrarily more complex such as the previously mentioned:

    • handling connections to multiple servers and using multiple user accounts;
    • using arbitrary rules to decide when connections should be really shut down, things like its age, how many similar connections there are, and so on.

    Database connection pooling is a specific case for a more general one, that of maintaining cached things where they may be expensive to start. As you see from a similar answer of mine, it can apply to thread pools as well (or pools of backup tapes, communication devices, laser cutters, or dozens of other different things).

    In all cases, it’s best if it’s "expensive" to bring another resource online rather than use one that had previously been online.

    That linked answer also shows one possible algorithm for deciding when to start up or (fully) shut down a resource.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We know that we can use a concept Java Package, but I just wanted
Just wanted to know what would happen if in my book database i had
I just wanted know, whether it is possible to create database tables in SDL
Just wanted to know how i would replace sitename.com with sitename2.com whenever a user
Just wanted to know. Is it possible to highlight text in ElasticSearch on an
Just wanted to know something about signed vs unsigned interpretation. Am I right if
Just wanted to know if anyone is really using Objects and Collections in Oracle
Just wanted to know if there is a big chance to inject SQL While
Just wanted to know if overriding UITabBarController would get my app rejected? Is it
Just wanted to know if is possible to use mod_rewrite on a single(or more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.