If you query is to get lookup type data, like all the states in the US then
you should query the db once and cache the result in an application scope
bean. If the data is not going to change why keep querying...is this your
question?
--
Tinou
www.tinou.com
----- Original Message -----
From: "Shawn Zhu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 5:54 PM
Subject: Re: [JSP-INTEREST] when to query vs when to use a 'model' bean?
> Set a limit on the number of records you are willing to keep in memory.
> once that limit hits, switch to querying the DB.
>
> Choose the right limit will help your sites performance.
>
> > -----Original Message-----
> > From: Rich Diaz [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 23, 2001 2:16 PM
> > To: [EMAIL PROTECTED]
> > Subject: when to query vs when to use a 'model' bean?
> >
> >
> > I'm kinda new to JSP and I'm making an application that will
> > access a database
> > to render most of my jps pages.
> >
> > Using MVC of course:
> >
> > Models: (beans of retrieved data)
> > Views: (jsp)
> > Controllers: (servlet to get data)
> >
> > I'm wondering where is the line when I should just re-query
> > the database vs
> > storing a database query in a bean? (beans taking up server memory).
> >
> > I don't want to keep querying the database vs storing a
> > common query result in
> > a bean for all my users (request) to use.
> >
> > thanks, and hope this made sense ;)
> >
> > Rich
> >
> >
> > ____________________________________________________________________
> > Get free email and a permanent address at
> > http://www.netaddress.com/?N=1
> >
> > ==============================================================
> > =============
> > To unsubscribe: mailto [EMAIL PROTECTED] with body:
> > "signoff JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set
> > JSP-INTEREST DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets