Hi,
Given a website where at a certain point in time a
dozen of users are connected that just want to view
a list of data. This data is extracted from the database
and presented by a
JSP page. Suppose the JSP page builds
the page and presents the data in tabular format by
iterating through a Vector that originated from the classes
handling database connection and queries and contains
the data records in the form of objects.
My question is: is the choice of the Vector as a collection
type overkill since it�s synchronized? My impression is that
when a user sees the data he/she asked for, any
thread dealing
with the Vector for presentation purposes (i.e. creating the
html formatted data) won�t be holding any locks anymore after
this operation has ended. Additionally different users of the
same website don't interfere in these operations.
Therefore no thread interferes with another, making
synchronization unnecessary.
What do you think?
Cheers,
Gian Franco
[ June 30, 2004: Message edited by: Gian Franco Casula ]