We use a web service like transaction model, so request comes in, transaction starts, hibernate session created.
On form submission, values are introspected directly onto the hibernate backed POJO, so when the request ends, the session closes and the transaction commits (not sure the exact order but...)
The problem is, if there are validation errors the transaction is not explictly rolled backed, so all changes are persisted.
What is the best way to handle this?
I could override a method in the Controller to mark transaction RO if there are validation errors?
I could introspect into a dataHolder and then manually copy properties from the holder into the hibernate POJO, but I *really* do not want to do that because that just sucks
Hmm, not sure. What do you guys/gals think?
And no, I cannot change the transaction demarcation