Hi,
I have a client that communicates to a long-running NH session via a web service, and I am using versioning to enforce optimistic locking.
When an object is successfully updated in the DB, its version number is incremented, which then renders the client-side version stale. So the client-side version number needs to be synchronized, otherwise the client will not be able to do any more updates.
The obvious solution is to send the entire updated object back down to the client to replace the original one, but this could be cumbersome depending on the complexity of the object. I had thought about simply incrementing the version in the client if the update is successful, but the version number is not updated unless the object differs from the one in the NH session.
So I was wondering if anyone had any thoughts on how to handle synchronizing version numbers in an efficient manner?
TIA,
Dean.
|