sds
Nov 26th, 2004, 05:08 AM
Hi,
I have a form object with inside a couple of domain objects. SessionForm is set to true. I first save the first domain object of the form, but on the second object I get an exception saving the object. The data gets correctly rolled back from the database and a nice error is shown to the user.
When the user corrects the problem and resubmits the form, the first object is get from the session and already has an id from hibernate and cannot be saved correctly any more. Is there a way in hibernate to rollback my first object, or do I have to manually clone the object before passing it to my service ? Should I always clone objects before sending them to the service layer ? Some advice please ...
Stefaan.
I have a form object with inside a couple of domain objects. SessionForm is set to true. I first save the first domain object of the form, but on the second object I get an exception saving the object. The data gets correctly rolled back from the database and a nice error is shown to the user.
When the user corrects the problem and resubmits the form, the first object is get from the session and already has an id from hibernate and cannot be saved correctly any more. Is there a way in hibernate to rollback my first object, or do I have to manually clone the object before passing it to my service ? Should I always clone objects before sending them to the service layer ? Some advice please ...
Stefaan.