Mike we do delegate our database access code to a hivemind service but that
is on the server.  I want the results to be cached on the cliient.  Been
thinking about it having a concrete method on my page may not be a threading
problems methods are thread safe right?  I just can't have concrete class
variable as this will pose a threading issue.  Even so... the 2 method
approach may not be the "standard" way of doing this. i have been searching
the forum and there is some information on using a TableModel - I have not
found an example that shows how to use this yet though.  Thanks for your
reply if i find anything else i will post it


On 3/25/06, Mike Snare <[EMAIL PROTECTED]> wrote:
>
> 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