You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Eyal Golan <eg...@gmail.com> on 2008/06/16 10:05:33 UTC

Session question

Hi,
we have our own customized session.
We have a field called pageId.

We set it whenever the user clicks a subclass of Link.
We call the getter in the linksTo of a link.
we have more than a few such links.

My question:
Is putting a field in a Session and call it makes the session "work to
hard"?
I'm not a web expert so maybe my question is naive, but does calling for a
field in a Wicket Session creates overload in the net?

Thanks

-- 
Eyal Golan
egolan74@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

Re: Session question

Posted by Michael Allan <mi...@zelea.com>.
Eyal wrote:
> isn't volatile will create overhead on the Session?
> Read this: http://www.javaperformancetuning.com/news/qotm030.shtml

Any overhead is essential, Eyal.  You *want* threads to flush their
memory caches, when accessing session variables.  Otherwise, variable
changes by one thread might be invisible to others.  (Alternatively,
you can sync.  But the overhead is probably higher.)

-- 
Michael Allan

http://zelea.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session question

Posted by Eyal Golan <eg...@gmail.com>.
thanks Michael,
That's what I thought.

BTW,
isn't volatile will create overhead on the Session?
Read this: http://www.javaperformancetuning.com/news/qotm030.shtml

Eyal G

On Mon, Jun 16, 2008 at 11:31 AM, Michael Allan <mi...@zelea.com> wrote:

> > Is putting a field in a Session and call it makes the session "work to
> > hard"?
> > I'm not a web expert so maybe my question is naive, but does calling for
> a
> > field in a Wicket Session creates overload in the net?
>
> No, it is common practice, in general.  Search the list for 'session'
> and 'field'.  (And maybe for 'thread-safe'. You probably want the
> field to be volatile.)
>
> --
> Michael Allan
>
> http://zelea.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Eyal Golan
egolan74@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

Re: Session question

Posted by Michael Allan <mi...@zelea.com>.
> Is putting a field in a Session and call it makes the session "work to
> hard"?
> I'm not a web expert so maybe my question is naive, but does calling for a
> field in a Wicket Session creates overload in the net?

No, it is common practice, in general.  Search the list for 'session'
and 'field'.  (And maybe for 'thread-safe'. You probably want the
field to be volatile.)

-- 
Michael Allan

http://zelea.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org