rampi wrote:
Do you mean that I instantiate another session in my Interceptor? and then do the comparison like you suggested.
Hum, I did not realize you do that in an interceptor.
In this *particular* case, an interceptor is useless since you actually know that you'll update the object.
To be honest, I've never tryed that at all and never think of a session call inside an interceptor.
rampi wrote:
Wouldnt that be a performance hit? since you would be creating a new session through the factory in your interceptor.
I don't think so, a session is light and you can reuse the same underlying conenction than in your initial session.
rampi wrote:
To do this wouldnt Hibernate
need to load the old state of the object being updated to do the version
check?
No
Code:
update ... where version=?