if you want to cache it you can cache it in the session
But for example hibernate objects that are not attached to the current
session
can give shitty errors

also caching of datatabase objects shouldn't be done in the web layer you
should use ehcache for that or something.
and you don't have to load the database object in the RequestCycle.onBegin
you just can do it lazy when you really need it.

johan



On 10/22/07, mfs <[EMAIL PROTECTED]> wrote:
>
>
> Johan,
>
> I am wondering if it would be a good approach to load the User (or any
> required object) for every request (i beleive you meant to override the
> newRequestCycle() method and provide impl for
> WebRequestCycle.onBeginRequest
> and WebRequestCycle.onEndRequst) and subsequently load/unload the object
> (based on id) in the corresponding methods..wouldnt it be considered
> rather
> a heavier operation to perform on every request compared to just storing
> the
> complete object in the session, OR MAY be we can put in some condition in
> (onBegin/onEnd methods) where based on the requested page we determine
> whether the required object is to be loaded from the data-store or not,
> though i am not sure if it possible to put in such condition ?
>
> Please comment..
>
> Thanks and Regards,
>
> Farhan.
>
>
>
> Johan Compagner wrote:
> >
> >>
> >> > I GET your point, but what about scenarios where one has regular
> >> objects
> >> > (e.g. Person) mapped as a model using CompoundPropertyModel on a
> page,
> >> > wouldnt it be reasonable to access/use the same object (which would
> >> > already be stored in session since its part of the page)..rather than
> >> > storing it seperately ?  to access it at other pages..
> >
> >
> >
> > objects that should be shared over multiply request and pages should
> just
> > be
> > stored in the Wicket Session object.
> >
> > If you don't want the complete object in it. then store the id (in
> wicket
> > session) and make your custom request cycle load that once
> > for the request so that you could use it where ever you want
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Accessing-PageMap---tf4668934.html#a13350486
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to