My more complicated work has been with T4, but this should still apply. I use Spring and Hibernate, with all of the Spring transaction management and the Open Session In View interceptor. When I find() an object, I do it declared READONLY. As all of the properties are updated from the form, it *looks* like everything is changing, but after the cycle completes, all changes are rolled back.
If everything works, then I invoke a persist() that will commit to the database. > -----Original Message----- > From: Angelo Chen [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 30, 2007 10:58 AM > To: users@tapestry.apache.org > Subject: Re: T5: Tapestry-Hibernate, do we have to save()? > > > Hi Lasitha, > > Your thoughts do require some thinking, I'm doing a site now that is not > so > critical in the consistency of the data, as it's merely a simple > membership > database, but if this is to replace a c/s biz application, this will be a > issue, is the current Tapestry - hibernate ready for that? what we need to > do in that kind of situation? I asked last time but it was considered a > hibernate issue, I like to hear from others too how they manage situations > like this? thanks. > > A.C. > > > lasitha wrote: > > > > On 10/30/07, Angelo Chen <[EMAIL PROTECTED]> wrote: > >> > >> is this really needed? I got confused, why the changes are saved > without > >> calling _session.save()? > > > > Angelo, this is default hibernate behaviour. See: > > > http://www.hibernate.org/hib_docs/v3/reference/en/html/objectstate.html#ob > jectstate-modifying > > > > However, your post brings up an interesting question: will the > > object's state be persisted even after validation fails? My first > > guess is might actually be a problem. > > Consider: > > 1. Object is retrieved in onAttached() and associated with a new > session, > > 2. Fields are updated with values from the form submission (lets > > assume they are valid), > > 3. Some cross-validation fails in onValidate() - so onSuccess() is > > never called, but... > > 4. As the thread cleans up, the HibernateSessionManager commits the > > transaction anyway and the invalid values are persisted! > > > > I'd like to test this and look around the lists a bit but am throwing > > this out in case others have thoughts. > > > > Cheers, lasitha. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: http://www.nabble.com/T5%3A-Tapestry- > Hibernate%2C-do-we-have-to-save%28%29--tf4718363.html#a13490149 > 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]