On 3/5/08, Wojciech Biela <[EMAIL PROTECTED]> wrote:
> Hello
>
>  my next problem has to do with the LoadableDetachable models, do you
>  really use them for every object you get from Hibernate? My views will
>  be full of various informational panels, drop-downs and others that
>  are based on data from the DB (retrieved as objects by Hibernate).
>  So if I have to make every one of them LoadableDetachable that means
>  that every refresh will cause a whole series of new queries to the DB,
>  or do you rely on 2nd level cache here (like EHCache), but then if I
>  have an object that I do update (most of them I use read-only) then I
>  loose the changes between requests because it is being detached
>
>  I agree to use them when the objects are noticeably big or not
>  serializable for some reason, but what about all the other cases, is
>  the fact that they come from Hibernate enough to just make a rule -
>  all hibernate object must be served to components as
>  LoadableDetachable models?
>
>  one thing I thought of is for some cases just to evict the objects
>  from the Hibernate session (the Dao would do that if asked for)
>
>  how do you approach this subject?
>
>

You also have to consider what you want to do when you're using
versioned objects.  If you just go get the latest object from the
database every time, then you'll never run into the version mismatch
and you won't know if one user is blowing away edits done by another
user.  In this case, you need to keep the original object around
somewhere.

>  --
>  Wojtek Biela
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to