• Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt regarding connection pooling  RSS feed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

take this scenario..

i am having maximum 100 connections(initial 50, increment=5,max=100) configured in my connection pool.
in the application runtime 100 users are already using the connections.
now the App. Server is not allowed to create another.

now my ques. is.. 101th user has came in, and he wants to do urgent updation in the DB and he needs a connection.He cant wait b'coz
he is in time bound application.in time he has to update. or else it is waste.

now what is the 101th user's updation has to do?

how can he get the connection?
 
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your load really that high? Are connections getting closed properly and freed up between uses? If your load isn't that high I would suspect they aren't getting returned to the pool. If they are, then why is the limit 100 if you need more than 100?
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You server will not be able to decide which request is urgent. Even if it is able to do so it will not be able to decide which of the 100 connection is the least important so that it can kill the connection.
If you have specified the max as 100, then the max is 100. The server will not open a 101st connection. It will wait for one of the 100 to close before it opens a new one for the waiting request.

HTH
Shikhar
 
Sanjaykar Gurram
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Thanks for your time.

Actually why i posted this in this forum is, i was asked this question by an interviewer. He told me this scenario and expected my answer.

yes, ofcourse a user doenst need a connection for a longer duration.
might be the interviewer wants to test me for a good answer.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!