If you use a hivemind service to access the database and cache the
results then it will be thread safe if you use the singleton service
model (the default).

In general, pages and components should delegate business logic like
this to services, so it would be a good idea to do it that way anyway.
 If you do it via services and the service handles the caching you
don't need to have two properties as in my original response.

On 3/24/06, John Menke <[EMAIL PROTECTED]> wrote:
> the getEntries method in this would not be thread safe if it's not abstract
> right?  i don't think this would work for me if it's not
>
> On 3/24/06, Mike Snare <[EMAIL PROTECTED]> wrote:
> >
> > What does getEntries look like?  If it goes to the database than it
> > makes perfect sense.
> >
> > why not:
> >
> > public abstract Collection getCachedEntries();
> > public abstract void setCachedEntries(Collection col);
> >
> > public Collection getEntries {
> > Collection cache = getCachedEntries();
> > if (cache == null) {
> >    cache = someCallToTheDatabase();
> >    setCachedEntries(cache);
> > }
> > return cache;
> > }
> >
> > On 3/24/06, John Menke <[EMAIL PROTECTED]> wrote:
> > > I have a table view component and i want to use session paging
> > >
> > > I have it configured like this:
> > >
> > > <component id="table" type="Contrib:TableView">
> > >        <binding name="source" value="entries"/>
> > >        <binding name="pageSize" value="10"/>
> > >        <binding name="columns"
> > >            value="literal: primaryTeamName, subTeamName,
> > > primaryTeamEventLocation, primaryTeamCaptainName, !join"/>
> > >        <binding name="tableSessionStateManager"
> > > value="new
> > >
> > org.apache.tapestry.contrib.table.model.common.FullTableSessionStateManager
> > > ()"/>
> > >    </component>
> > >    <component id="tableColumns" type="Contrib:TableColumns"/>
> > >    <component id="tableRows" type="Contrib:TableRows"/>
> > >    <component id="tableValues" type="Contrib:TableValues"/>
> > >    <component id="tablePages" type="Contrib:TablePages"/>
> > >
> > > <property name="entries" persist="session"/>
> > >
> > > I was expecting the paging to be done through the session but this is
> > not
> > > working.  It goes back to the database every time.
> > >
> > > What am I doing wrong?
> > >
> > > -jm
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to