Solved

How the tomcat web application manage client threads, and database connections

Posted on 2006-07-20
4
364 Views
Last Modified: 2013-12-03
Hi,

Currently I am looking at one web application project written by a consultant. The project has the kind of structure of Tomcat+JSP+Servlet+ JDBC transaction +Sql Server DB. I am not very familiar with web application server. I just wonder, how can the application handle multiple clients viewing the jsp pages, and multiple connections to the database? The resources are limited so must have controlls somewhere. Are both of that controlled by tomcat? Or tomcat controlls clients, and jdbc controlls database connection? From the project, I can't tell. Can anyone give me some hints? Thanks.
0
Comment
Question by:ly_uwo
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
anumalas earned 500 total points
ID: 17151796
Hi

All the configuration settings are under web.xml configuration file of your project contains servlet information, tag lib information etc.,

For each and evey client request Tomcat webcontainer will create one thread(not instance) .

jdbc calls will be controlled by the Connection pool (which contain data sources) So Tomcat only controls the database connection also.   JDBC is a stanadard abstraction to manage database data.
JDBC and JNDI related configurations  setting are under $CATALINA_HOME/conf/server.xml.

Please refer your server.xml 's <context> </context> to know about JNDI configuration.

For further details refer

http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html

http://www.onjava.com/pub/a/onjava/2001/04/19/tomcat.html?page=1

Hope this will help :)
0
 

Author Comment

by:ly_uwo
ID: 17153475
Thank you, very instructive. My understanding is:

By configuring the client connections and database connections in the server.xml, the threads accessing web pages and databases are both got contolled. Thus there is no need to add a thread pool component for the project to manage the connections.

Is that true? Thanks a lot.
0
 
LVL 3

Expert Comment

by:anumalas
ID: 17156585
HI

Its true. but what im trying to say is that  treads will be managed by a web container.

if you want to perform and manage well your web application try to improve your access prospectives like

if you want to improve your search crieteria develop index mechanism from A-Z

if you want to pre available your application specify <load-on-startup>1</load-on-startup> in  web.xml
 to make your jsp's available preior.

but ThreadPool is not a constraint on behalf of web-application

im again giving an option to you to go thru web application architecture and cntrolling  and to know more about tomcat

please go thru above specified first link

Dont confuse  hope you will get good understanding with in soon :)

have a great day
0
 

Author Comment

by:ly_uwo
ID: 17158517
what do you mean by "but ThreadPool is not a constraint on behalf of web-application "? Is that meaning I can add thread pool to the application to provide extra thread control? Thanks.

I will also go over your first link.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Apache-Tomcat Single Sign On with NTLM/Kerberos on Windows 2008R2 3 211
some methods private some are not 8 210
servlet concurrency 13 100
Color? 8 101
When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question