This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Maintaining scalability in servlets programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Maintaining scalability in servlets programming " Watch "Maintaining scalability in servlets programming " New topic
Author

Maintaining scalability in servlets programming

sanju dharma
Ranch Hand

Joined: Oct 19, 2000
Posts: 45
What should be done to maintain same database connection in all servlets & improve on scalability issue.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
If you want to have the costly database connectins to be created alreday and ready for all servlets within an web application, you can create a COMMON Connection Pool of Database connections and put it in ServletContext. Each Servlet when first loaded checks for the connection-pool attribute in ServletContext, if not found then creates one and it volunteers to put it in servletCOntext. Essentially if there are 10 servlets in the whole web application ONLY one of the 10 will CREATE the connection pool and others just USE the already exisiting Connection pool in Servlet Context. I use this tech, and I add this code in init() of each servlet.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maintaining scalability in servlets programming
 
Similar Threads
JSP Efficiency vs ASP
Using JSP without Javabeans and servlets
Q on common architecture...
scalability in Database
CGI vs Servlets