• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connection pooling

 
Sanjaykar Gurram
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 come in, and he wants to do an urgent updation in the DB and he needs a connection.He cant wait b'coz
he is in a time bound application.in time he has to update his work, or else it is waste.

now how can the 101th user can get the connection?
what the application server is going to do in this scenario?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The server doesn't know or care about request priority. It works on a first come, first served policy. It can't interrupt any current connections because that would break whatever the other users are doing and would leave the database in an unknown state. So it must wait for a connection and if this urgent request is the next in line, it will give it to him.

If you want to provide a priority-based connection system you will have to manage separate connection pools, reserving 1 or more connections for those high priority cases.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A well-written application will hold connections for the shortest duration possible, so no one should have to wait very long for a connection. How long does your application hold onto connections?
 
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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well yeah, usually.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic