On 4/6/07, Carlos Pita <[EMAIL PROTECTED]> wrote:
> On 4/6/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > It's not a good idea to use LoadableDetachableModel for entities that
> > > you edit. Because they are detached after every request.
> >
> > Sorry, but I don't agree with that :) LDMs are my favorite models for
> > such use. The only thing you have to keep in mind is to persist any
> > changes coming in with a request you are interested in, or you'll lose
> > them. But if you do that, it'll work fine.
> >


> find the approach clumsy when a lot of ajax round-trips are involved;
> the object is reloaded just for setting a property and discarded
> again; also, depending on how you configure your transactions, you
> could end up persisting partial non-validated changes

Also, reloading the entity from "state zero" every time could be
problematic when incrementally updating it using ajax. In this case
just the updated property P is bound during the ajax request. Normally
this is enough for chained dropdowns and the like. But in the general
case, if there are other dependant properties Q1,...,Qn that should be
updated as a function of the modified property P and others P1,...,Pm
(whose value would be that of state zero, disregarding any previous
update), you have a problem. Anyway, I don't think that this scenario
would be frequent in practice.

Cheers,
Carlos

 (although I
> should say that from my observations this doesn't happen inside a
> vanilla OpenSessionInViewFilter spring setting). I've been coding some
> examples with convoluted entity lazy-loaded associations and, despite
> my previous fears, detaching/re-attaching it from/to the hibernate
> session works like a charm. I think I will tag all my editable
> entities as Serializable and embrace this approach.
>
> Cheers,
> Carlos
>
> > Eelco
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys-and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to