Unless you have a read-only database you should re-query every time.
It is your database server who already has your previous SQL statement
and/or query data cached so doing new queries will be faster and it is the
best way to know you are using actual data.
Depending on your application, maybe you also will need to consider using
EJBs (Entity and Session beans) instead of JavaBeans.
Benjamin
-----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