I have wriiten my connection pooling by extending connection and driver class. It is working fine but the problem is I want to now impose a upper limit and if te upper limit is reached then I want to store the request in the queue and return when any connections are free. How can I do this. Thanks in advance for replys
This is a bad, bad design.
Your pool should not require you to extend anything. It should not be concerned with requests, either. Just check connections in and out. Have another component manage a queue of requests and collaborate with your pool to get connections.
Connection pools have been done. The easiest one to maintain is the one that's written by someone else.
精彩评论