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 642803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:12:48+00:00 2026-05-13T21:12:48+00:00

When some one asks you to write (do / depict) design for Connection Pool

  • 0

When some one asks you to write (do / depict) design for Connection Pool in a Java interview what would you typically write.

Do you write code for connection pool or do you depict the Class diagrams. Can somebody please explain the design of Connection pool.

  • 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-13T21:12:48+00:00Added an answer on May 13, 2026 at 9:12 pm

    Object Pool pattern (and Connection Pool is a particular case of it) is greatly described in Mark Grand’s ‘Patterns in Java. Vol. 1’.

    Here is a basic class diagram (from google images):

    alt text http://img13.imageshack.us/img13/8448/poolz.png

    Main idea: Client shouldn’t create Reusable objects by himself. Instead of that he should use ReusablePool. To get Reusable object he should call acquireReusable. When he doesn’t need Reusable object any more he should put it back trough calling releaseReusable.

    ReusablePool contains a list of Reusable objects. When Client asks for Reusable, pool looks for existing free Reusable. If all Reusable objects are acquired then if list size is less then maxSize ReusablePool creates one more Reusable object. When list size is equals to maxSize pool doesn’t create new Reusable. Instead of that it waits until some other client give him back any Reusable object.

    From this description you can make 2 conclusions:

    1. Reusable objects shouldn’t have a state (or their state should be ‘cleared’ in releaseReusable method)

    2. ReusablePool is usually a part of multithreading applications and all synchronization stuff inside all its methods should be implemented in a proper way (and it’s not an easy task).

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

Sidebar

Ask A Question

Stats

  • Questions 380k
  • Answers 380k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer just noticed this one hadn't been answered - we resovled… May 14, 2026 at 9:54 pm
  • Editorial Team
    Editorial Team added an answer This post explains the problem and a possible solution (similar… May 14, 2026 at 9:54 pm
  • Editorial Team
    Editorial Team added an answer You might have to write your own split function. Iterate… May 14, 2026 at 9:54 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.