If I run a web application that uses "normal" Java classes, say this application is running under Tomcat or any other web container, (1) do I need to be consent about synchronizing the code in "normal" classes? By normal classes I mean classes that I can run in any Java JVM. An example could be an Employee class which does all sorts of things. This Employee class might have methods that requests data from the database (asking other objects to access the database for it), for instance and many other operations that need to be executed atomically.
My understanding so far is that when a web application executes, there is only one JVM that is started. Any other object(servlet) whose services are required will be instantiated and run under the running JVM through threads. The Employee class I mentioned above, (2)if its instance is required to provide some kind of a service to a servlet, is it also loaded in the running JVM or is a separate JVM started for it and any other non-servlet objects?
I am gratefully looking forward to your replies to my two questions.