You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sa...@women-at-work.org on 2005/06/05 14:53:17 UTC

Persistent data outside of page scope (setupForRequest...)

If I want to "remember" data within the global object in a map
and generate it within setupForRequest, it is called and generated for every
page request....although it should be held within the webserver somewhere.

Where would I generate it if I only want to generate it once
for the whole web application and not for every page request ?


Where and how would I generate it if I only want to generate it once
for a single user for the whole web application ?


Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Caching Lookup Tables with Tapestry and Hibernate

Posted by Ricardo Cortes <rc...@boltstaff.com>.
While 2nd level caching in Hibernate (for reference data) works just
fine it is the overall object caching that is weak in Hibernate.  JBoss
TreeCache is often the solution used in conjunction with Hibernate's 2nd
level cache and that requires the JBoss instances to be clustered.

On Tue, 2005-06-07 at 10:28 -0500, Javier Sanchez wrote:
> Hibernate is certified with some 2nd level cache managers.  For
> example, look at http://www.hibernate.org/158.html for a description
> of EHCache in Hibernate.
> 
> JAVIER SANCHEZ
> EDESA S.A.
> 
> On 6/7/05, sarah.simbad@women-at-work.org
> <sa...@women-at-work.org> wrote:
> > How would you handle lookup tables
> > with tapestry and hibernate ?
> > 
> > The analogues approach using Cayenne is described here:
> > 
> > http://www.objectstyle.org/cayenne/userguide/perform/caching-lookup.html
> > 
> > What about the hibernate approach for tapestry applications
> > that need to cache lookup tables?
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Caching Lookup Tables with Tapestry and Hibernate

Posted by Javier Sanchez <ja...@gmail.com>.
Hibernate is certified with some 2nd level cache managers.  For
example, look at http://www.hibernate.org/158.html for a description
of EHCache in Hibernate.

JAVIER SANCHEZ
EDESA S.A.

On 6/7/05, sarah.simbad@women-at-work.org
<sa...@women-at-work.org> wrote:
> How would you handle lookup tables
> with tapestry and hibernate ?
> 
> The analogues approach using Cayenne is described here:
> 
> http://www.objectstyle.org/cayenne/userguide/perform/caching-lookup.html
> 
> What about the hibernate approach for tapestry applications
> that need to cache lookup tables?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Caching Lookup Tables with Tapestry and Hibernate

Posted by sa...@women-at-work.org.
How would you handle lookup tables
with tapestry and hibernate ?

The analogues approach using Cayenne is described here:

http://www.objectstyle.org/cayenne/userguide/perform/caching-lookup.html

What about the hibernate approach for tapestry applications 
that need to cache lookup tables?


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Persistent data outside of page scope (setupForRequest...)

Posted by sa...@women-at-work.org.
Found something similiar using Cayenne...

http://www.objectstyle.org/cayenne/userguide/perform/caching-lookup.html


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Persistent data outside of page scope (setupForRequest...)

Posted by Ron Piterman <mp...@vollbio.de>.
I can't really follow what you want to do, sorry.

I am using the following method, in components, pages, in visit and in 
global:

public getMap() {
  if (_map == null)
   initializeMap();
  return _map;
}

this way, it will be null-safe. all you have to worry about is when do 
you set it to null...

Cheers,
Ron


ציטוט sarah.simbad@women-at-work.org:
> What about the following:
> 
> - a static synchronized hashmap within the global
> - initialize it within the constructor of the global object ?
> 
> Sarah
> 
> 
>>--- Ursprüngliche Nachricht ---
>>Von: Pablo Ruggia <pr...@gmail.com>
>>An: Tapestry users <ta...@jakarta.apache.org>
>>Betreff: Re: Persistent data outside of page scope (setupForRequest...)
>>Datum: Mon, 6 Jun 2005 02:30:28 -0300
>>
>>On 6/5/05, sarah.simbad@women-at-work.org
>><sa...@women-at-work.org> wrote:
>>
>>>If I want to "remember" data within the global object in a map
>>>and generate it within setupForRequest, it is called and generated for
>>
>>every
>>
>>>page request....although it should be held within the webserver
>>
>>somewhere.
>>
>>>Where would I generate it if I only want to generate it once
>>>for the whole web application and not for every page request ?
>>
>>For the whole application, put it in the global object. You can put
>>that logic perhaps in a listener declared in your web.xml or in
>>servlet initialization.
>> 
>>
>>>Where and how would I generate it if I only want to generate it once
>>>for a single user for the whole web application ?
>>
>>For a single user put it into the visit object. You can put the logic
>>in setupForRequest, if user's data is null then create user data, else
>>nothing.
>>
>>
>>
>>>
>>>Thanks!
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Persistent data outside of page scope (setupForRequest...)

Posted by sa...@women-at-work.org.
What about the following:

- a static synchronized hashmap within the global
- initialize it within the constructor of the global object ?

Sarah

> --- Ursprüngliche Nachricht ---
> Von: Pablo Ruggia <pr...@gmail.com>
> An: Tapestry users <ta...@jakarta.apache.org>
> Betreff: Re: Persistent data outside of page scope (setupForRequest...)
> Datum: Mon, 6 Jun 2005 02:30:28 -0300
> 
> On 6/5/05, sarah.simbad@women-at-work.org
> <sa...@women-at-work.org> wrote:
> > If I want to "remember" data within the global object in a map
> > and generate it within setupForRequest, it is called and generated for
> every
> > page request....although it should be held within the webserver
> somewhere.
> > 
> > Where would I generate it if I only want to generate it once
> > for the whole web application and not for every page request ?
> 
> For the whole application, put it in the global object. You can put
> that logic perhaps in a listener declared in your web.xml or in
> servlet initialization.
>  
> > Where and how would I generate it if I only want to generate it once
> > for a single user for the whole web application ?
> 
> For a single user put it into the visit object. You can put the logic
> in setupForRequest, if user's data is null then create user data, else
> nothing.
> 
> 
> > 
> > 
> > Thanks!
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Persistent data outside of page scope (setupForRequest...)

Posted by Pablo Ruggia <pr...@gmail.com>.
On 6/5/05, sarah.simbad@women-at-work.org
<sa...@women-at-work.org> wrote:
> If I want to "remember" data within the global object in a map
> and generate it within setupForRequest, it is called and generated for every
> page request....although it should be held within the webserver somewhere.
> 
> Where would I generate it if I only want to generate it once
> for the whole web application and not for every page request ?

For the whole application, put it in the global object. You can put
that logic perhaps in a listener declared in your web.xml or in
servlet initialization.
 
> Where and how would I generate it if I only want to generate it once
> for a single user for the whole web application ?

For a single user put it into the visit object. You can put the logic
in setupForRequest, if user's data is null then create user data, else
nothing.


> 
> 
> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Persistent data outside of page scope (setupForRequest...)

Posted by Patrick Casey <pa...@adelphia.net>.
Public static final Map foo = new HashMap();

> -----Original Message-----
> From: sarah.simbad@women-at-work.org [mailto:sarah.simbad@women-at-
> work.org]
> Sent: Sunday, June 05, 2005 5:53 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Persistent data outside of page scope (setupForRequest...)
> 
> If I want to "remember" data within the global object in a map
> and generate it within setupForRequest, it is called and generated for
> every
> page request....although it should be held within the webserver somewhere.
> 
> Where would I generate it if I only want to generate it once
> for the whole web application and not for every page request ?
> 
> 
> Where and how would I generate it if I only want to generate it once
> for a single user for the whole web application ?
> 
> 
> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org