• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

enterprise application with many users

 
Ranch Hand
Posts: 590
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

if an enterprise application accessed by many user then how the get they database connection.Generally database has limited connection.Then an enterprise application servers many who needs database connection at a time?
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Connection pool.
 
jacob deiter
Ranch Hand
Posts: 590
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree connection pool,

but the explain the below listed scenario

if the pool limit is 25 but more request comes in ,if the pool itself not able make more data base connection,then how to serve the all request ? ,


how many concurrent request can be handled by oracle database with connection pool(max number)
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There may be 1000 or more user session active at a given time but not all need DB connection at same time. If any user action requires connection to DB, thead request to pool for connection and complete the work and return the connection to pool as soon as possible. In case no connection is available Connection pool manager will try to make new connetions to DB to fullfill the request. If connection count reaches to max count, requester can wait in queue for some time for connection to be released by some theads. It may timedout after some time and thread will get no connetion available or timed out exception.

Pooling is a trick to manage/share expensive resource. It helps in sharing resource among lots of users. EJB use object pooling in same way. A big family can share two bathrooms. There is no problem if no more than two family members need them at same time. If any memeber needs it and both bathroom is in use, that person have to wait until one is free. There would be exception in case waiting time is too long. But everything would be fine if family member try to minimize the time spent in bathroom to keep them free as much as possible. It would be very costly to make one bathroom for each memeber

So its important to use these type of resorces carefully. Request connection when you are ready for DB trasaction after all calculations and processing on data is done. Return/close the connection as soon as you are done. Don't wait for garbage collection to close it.

Last thing ..if DB server allows 25 connection max than there is no way more than 25 connection made. But through pooling they can be shared by thousand users.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Explanation Alok
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic