Thiago H de Paula Figueiredo wrote: > On Tue, 19 Jun 2007 18:24:10 -0300, Norman Franke <[EMAIL PROTECTED]> > wrote: > >> 1. As Michael noted, they aren't thread safe. >> 2. This really gets to a bigger issue, in that these objects aren't >> valid outside of a session. Once the session closes, they are >> technically invalid according to what I read in "Hibernate in >> Action". This is because Hibernate may want to lazy fetch things, >> e.g. relationships. > > In a second request and therefore a second session, you can merge your > your detached instance using the Object merge(Object o) method of > Session. The returned object has the same values as yours detached > one, but it is associated with the session.
Unless I'm mistaken, merge()'ing the same object into two different Sessions isn't any more safe than using update() or lock(), so you still have to deal with thread safety issues when using it. Do you have reason to believe otherwise (or maybe I completely misunderstood your point)? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]