File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes enterprise application with many users Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "enterprise application with many users" Watch "enterprise application with many users" New topic
Author

enterprise application with many users

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
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?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Connection pool.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
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)
Alok Kushwah
Ranch Hand

Joined: Jul 10, 2007
Posts: 31
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.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Good Explanation Alok
 
 
subject: enterprise application with many users
 
Similar Threads
JBOSS SecureIdentityLoginModule - How to Manage the Encrypted Passwords?
MVC example or tutorial
DAO Layer
simple question
Tomcat and EJB