[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2006-07-20
4
Medium Priority
?
380 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
anumalas earned 2000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

656 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