Sorry, my questions have nothing to do with Tapestry - put a few things you
mentioned piqued my interest.


Norman Franke wrote:
> In my case, my DAO has an  
> "assertUnchanged" method that throws an exception if the two objects  
> differ, e.g. my detached object and the one read from the database.  
> In this case, I tell the user that someone else changed their record  
> and their changes have been lost.

Why not rely on Hibernate's version support for detached objects and
versioning?


Norman Franke wrote:
> 
> To persist a detached object, I call a clone() function on all of my  
> DB objects that converts it back to a normal POJO (from whatever  
> Hibernate does to it.)
> 

Why clone the detached object graph?  Why not have the DAO reattach it to
the session and save it -- assuming it passes your version check?

Carlos
-- 
View this message in context: 
http://www.nabble.com/Using-Hibernate-detached-objects-in-Tapestry-%28thread-safety-question%29-tf3930468.html#a11197907
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to