From: "Carter, Scott" <[EMAIL PROTECTED]>
Sent: Tuesday, July 30, 2002 1:12 PM


> I have a site that users will be able to access information on other
users.
> Users and their information will be stored in a back-end database for
> persistence reasons, but my question is :  I would like to read an object
> that is an array of users into the ServletContext so that all instances of
> the servlet can retrieve the object and display the appropriate info.  Is
> this a good way of doing this, or is it better to make a call to the
> database when a user requests this information?

It depends on how "up to date" the data needs to be. If you're going to
store it locally, and use that as a reference, you'll need to refresh it as
regular intervals (perhaps through thread). The amount of time between
refreshes is your window for the data to go "stale".

Also note that you'll need to synchronize access to this list so that your
servlets can access it (or not) while it is being updated by the server.

But, all in all, "it depends" on your application whether this technique is
appropriate or not.

Regards,

Will Hartung
([EMAIL PROTECTED])

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to