I was thinking of using versioning, in a databound winforms environment, and I have come across a problem (in my head so far) which I cannot see a way around.
I think I need to keep a session open, due to the fact that I have a lazy loaded collection in my objects (think invoice header holding a list of invoice items): session disconnection would not work here.
My ideal solution would be to use versioning to see if anyone else has modified the invoice data whilst it has been modified by another user.
Should a version conflict occur, I want to display the object from the persistent store, and the edited object side by side, and ask the user whether to abandon changes, or commit to the persistent store.
Has anyone managed this scenario ?
Second problem associated with this:
It says in the NHib docs, to close the session upon an exception (think StaleObjectStateException). Now, couple this with a long running session with possibly many changes from various databound activities, any exception due to maybe only 1 version conflict, and all changes recorded in the session are gone ??
Is there any way to cancel the changes recorded in a session, for one object only ??
Thanks.
|