• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

connection pooling

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well yeah, usually.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic