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. >
I used to thought like that too (a couple of hours ago :) ), but I 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 (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