I am evaluating a jsp application for a customer, which provides an interface to a database through some helperclasses.
Each helper class manages the retrieval (and updates) of related underlying tables, and there are about 10 helperclasses.
In the header (header.jsp) the jsp calls an initialize method on a Configuration object, checks if it is already initialized
(this process is not synchronized), and if not, creates one connection, creates all the 10 helper classes as static instances passing this one-and-only connection.
In the rest of the application a collection of tags call the static methods (unsynchronized) on the Configuration object, such as
getDatabaseHelper1 (be it with a more descriptive name) and performs operations on the underlying database through this class.
All the methods in the Helper classes are unsynchronized as well, but they are standalone (utility functions, I don't know a better way to describe it).
My question is, except from any race conditions in the helper classes themselves, is it a problem that all those helper classes share only one connection and access it unsynchronized. If so, why is it a problem if unsynchronized communication occurs on a database connection? Or are all the underlying methods on the connection object already synchronized and is there no need to worry?
Some pointers to why and how would be appreciated as well. And I am not only looking to why connection pooling would be good, but also why one connection would be bad ;-)
kind regards Hans
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]