It depends on some parameters:-

1. How many users you have in the database? If the number is very large then
better to hit database everytime.
2. Whether the user data changes regularly? If yes then you may need to
update the object regularly otherwise users will      get the obsolete data.
3. If you store data in object then you require a lot of memory for the JVM.
So compare this with databse hits.

-----Original Message-----
From: Carter, Scott [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 4:12 PM
To: [EMAIL PROTECTED]
Subject: retrieving info at run time (best practice)?


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?

Thanks - Scott Carter

___________________________________________________________________________
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


"The information in this e-mail, and any attachment therein, is
confidential and for use by the addressee only. If you are not the
intended recipient, please return the e-mail to the sender and delete
it from your computer. Although The Bank of New York attempts to
sweep e-mail and attachments for viruses, it does not guarantee that
either are virus-free and accepts no liability for any damage sustained
as a result of viruses."

___________________________________________________________________________
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