the reason you should be most concerned is that
in one request session#1 loads the object
in other request session#2 loads objects
if you use relations from second request LazyLoadExceptions will happen
if you try to force old object from #1 to session#2 you can fix problems
but this is not recomended approach

to ensure less headaces and complicated ecxeptions (for me at least :) )


keeping session free of large objects should concern you only for high
traffic sites
and DDR2 is so cheap nowdays, or when in a cluster that serializes session.


to optimize database access you shoud use hibernate's second level cache
and not try to hold on to loaded objects for speed.

I tried all those wrong ways of working with hibernate ... and belive me
it is no fun at all  :D

Davor Hrg




On Feb 20, 2008 9:14 AM, Chris Lewis <[EMAIL PROTECTED]> wrote:
> This is a great list to have around - perhaps we can add reasons for
> each of the steps. Davor I've heard what you're saying before, but I
> forget the reason behind it (I assume LazyLoadException has something to
> do with it). Is it for keeping http session free of large objects?
> Preventing LazyLoadExceptions? What if you make it transient first (if
> you can without deleting it)?
>
>
> Davor Hrg wrote:
> > also,
> >
> > don't persist hibernate entities, persist keys only
> >
> >
> > On Feb 20, 2008 3:01 AM, Angelo Chen <[EMAIL PROTECTED]> wrote:
> >
> >> Hi,
> >>
> >> What is the proper way of using hibernate in T5?  is following list 
> >> correct?
> >>
> >> 1. Don't commit, let Tapestry-Hibernate take care of that.
> >> 2. Commit only if you are going to start a thread with Session as well.
> >> 3. Use session.save for the new objects, after that, any updates to the
> >> object does not require a save
> >>
> >> ?
> >>
> >> A.C.
> >> --
> >> View this message in context: 
> >> http://www.nabble.com/T5%3A-how-to-use-Hibernate-properly--tp15580722p15580722.html
> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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]
> >
> >
> >
>
>

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

Reply via email to