OK, I was wrong. You have some issues.
Originally posted by David Garratt:
Lets assume that all my database and business logic is in a single file
That's moot. They all just become part of the classpath. How they are organized into jars is not significant.
Within all this code there are bound to be lots of static variable
Static read-write variables? That's a problem in any scenario and needs to be fixed.
and I know for a fact that I only have one database connection open at a time.
Needs to be replaced with container-managed connection pooling.
How many instances of my1stServlet are running on the server, I guess just one ?
One.
How many instances of my "do_updates" are in memory ?
As many as there are threads.
What about all those static variables ?
Serve as a lesson to always write good object-oriented code. They'll obviously need to be converted to instance variables.
A good rule of thumb to keep in mind is that every time you use the keyword
static, if it's not paired with
final, it means it's time to think about your design since it's probably a problem.
[ March 09, 2007: Message edited by: Bear Bibeault ]