aspose file tools*
The moose likes JDBC and the fly likes How can we deal if Users are exceeded to connection pool size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How can we deal if Users are exceeded to connection pool size" Watch "How can we deal if Users are exceeded to connection pool size" New topic
Author

How can we deal if Users are exceeded to connection pool size

Rama Satti
Greenhorn

Joined: Jun 24, 2008
Posts: 3

Hi to all,

I came across the question in an interview. The scenario like this,

for example our connection pool size is: 200. Currently 200 users (all Active users) are accessing the site.
What is going to happen if a new user(201th user) is going to access the site.
How can we deal the situation?


Discuss all situations we need to take care of, when we came across this situation.

Thanks in advance.

Regards
Krishna
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3832

One thing I can think of, reduce the scope to minimum in which the connections are used in the application (of course this is in the code level). But as with your statement if all 200 connections are in use at the same time then the next user will simple have to wait.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41904
    
  63
I think it's unlikely that all 200 users will access the web app in a way so that 200 connections will be open at the same time. While it's a possibility (and obviously depends on the application), I'd say that a pool of size 50 should be plenty big enough to serve 200 simultaneous users.

Most likely, I wouldn't make the pool bigger than 50 (rather smaller), because the DB is not going to be particularly responsive it if has to handle 50 queries at the exact same time.


Ping & DNS - my free Android networking tools app
 
Consider Paul's rocket mass heater.
 
subject: How can we deal if Users are exceeded to connection pool size