Note - Poolman cacheing of lookup type results can be great - but you need to set the time-out appropriately...
Consider a busy site. Even cacheing for 3 minutes can save a lot of lookups. If you do update the table, after 3 mins it should refresh... ----- Original Message ----- From: "Brandon Goodin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 19, 2001 3:07 PM Subject: RE: Options population from a Database > YES!! IT WAS POOLMAN. cacheEnabled was true. Is now false > > God Bless You and prosper you. I spent too much time on that one. > > Thanks > Brandon Goodin > -----Original Message----- > From: Robert Parker [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 18, 2001 11:09 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: Options population from a Database > > > Is your connection pool cacheing results - for example Poolman can cache > results > > ----- Original Message ----- > From: "Brandon Goodin" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, October 19, 2001 2:22 PM > Subject: Options population from a Database > > > > I am running into a bit of a problem and I wondered if others have had > this > > too. I am populating an options tag by creating a bean collection using > > values from a resultset and then calling that collection from the options > > tag using property="value" and labelProperty="label" which are of course > the > > getters in the the beans of the bean collection. My problem happens when I > > add to the database and the change should reflect in the results of the > bean > > collection refreshing the bean collection. It does not. I does however > > reflect the additional tables that have been written to the database when > I > > restart tomcat. I have encapsulated the code that creates the bean > > collection into a tag that handles the sql call, bean population and > > collection population. > > ------------------------------------------------------- > > The code in the tag is as follows: > > ------------------------------------------------------- > > package ws.phase.storeadmin.tags; > > > > import ws.phase.sql.*; > > import ws.phase.beantools.*; > > import ws.phase.logging.*; > > import com.codestudio.sql.*; > > import java.sql.*; > > import javax.sql.*; > > > > import javax.servlet.jsp.*; > > import javax.servlet.jsp.tagext.*; > > import javax.servlet.*; > > import java.io.*; > > import java.util.*; > > /** > > * > > * @author Administrator > > * @version > > */ > > public class CatOrderList extends TagSupport{ > > > > > > public int doStartTag() throws JspTagException { > > return EVAL_BODY_INCLUDE; > > } > > > > public int doEndTag() throws JspTagException { > > try{ > > String property; > > String value; > > > > Connection conn = null; > > Statement stmtread = null; > > String sql = ""; > > > > sql = "SELECT NAME FROM CATEGORY"; > > conn = ConnectionPool.getConnection(); > > stmtread = > > > conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ > > _ONLY); > > ResultSet rs = stmtread.executeQuery(sql); > > int count=0; > > ArrayList list = new ArrayList(); > > > > while(rs.next()){ > > count=count + 1; > > list.add(new > > LabelValueBean(String.valueOf(count),String.valueOf(count))); > > } > > count=count + 1; > > list.add(new > > LabelValueBean(String.valueOf(count),String.valueOf(count))); > > pageContext.setAttribute("catlist", list); > > conn.close(); > > > > } catch (SQLException ex) { > > } catch (IOException ex) { > > } > > > > return EVAL_PAGE; > > } > > } > > > > ------------------------------------------------------- > > The select and option tags are as follows > > ------------------------------------------------------- > > <html:select property="type"><html:options collection="catlist" > > property="value" labelProperty="label" /></html:select> > > > > ------------------------------------------------------- > > Problem recap > > ------------------------------------------------------- > > > > - My page works great the first time it is called the select/option tag > > produces a drop down from the database results (which are just numbers > that > > define a display sequence for the addition of a category) > > > > - Once a category is added and I return to the add a category page the > drop > > sequence drop down does not reflect that an additional record has been > added > > and produces the same amout of numbers in the sequence dropdown > > (selec/options dropdown). > > > > ------------------------------------------------------- > > Question > > ------------------------------------------------------- > > > > If I call the population of the bean collection from the top of the jsp > page > > and make a call to the database then why doesn't it update the results of > my > > sequence options dropdown. > > > > > > > >

