As a side note, you still can pass in the full object, even in 1.2,
that is what we are doing in our application constantly. You do have
to be careful to always use the shared model, otherwise you'll get
LazyInitialization exceptions...

Sharing the model between components on one page is a good thing (tm),
and can save some memory. In my opinion, understanding the lazy pull
approach of the wicket models is key in building Wicket applications.

Person person = (Person)getModelObject();
setResponsePage(new FooPage(person));

public class FooPage extends WebPage {
    public FooPage(Person person) {
        IModel shared = new CompoundPropertyModel(new HibernateModel(person));
        setModel(shared);
        ....
        add(new ListView("children") {...});
        ....
        add(new Form("form", shared){...});
    }
}

Martijn

On 7/16/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> yeah, you miss something. load-by-id is a cheap operation. first of all
> session.get(id) will return the cached object within the same request. and
> even if the first level cache misses(the session) the second level cache
> will most likely have the object where it is kept across requests.
>
> so if you pass the id to many panels within the same request the object is
> still only loaded once. within many requests the chances are good it is in
> second level cache. i wouldnt even attempt to use an orm solution without a
> good second level cache setup.
>
> if you want extended sessions there is really nothing stopping you from
> doing that either. all you have to do is create the session yourself,
> disconnect it at the end of request and reconnect it at the beginning of
> another. all perfectly doable in wicket. then you just have to pass the
> session around from page to page.
>
> -Igor
>
>
>
> On 7/16/06, Iman Rahmatizadeh <[EMAIL PROTECTED]> wrote:
> > Juergen Donnerstag wrote:
> > > I don't think this is true if you create a hibernate session per http
> request
> > >
> > > Juergen
> > >
> > >
> > When you pass the object id instead of the object to the panels, each
> > panel will retrieve the object independent of others. Maybe a cache will
> > help. But still it goes through the persistence layer. Am I missing
> > something ?
> >
> > Iman
> >
> >
> >
> >
> >
> >
> -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job
> easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>


-- 
Download Wicket 1.2 now! Write Ajax applications without touching JavaScript!
-- http://wicketframework.org


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to