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#objectstate-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]