Bug with sessions

May 12, 2015 at 12:55 AM
I am using OperationContext and if i create 2 sessions and if i call SaveChanges on one of them and there is ClientFault error if i call save changes on the other i get the same error.

If there is no clientfaults on savechanges it does not afect the other.

May 12, 2015 at 6:06 PM
Well, I would not call it a bug, this is kind of expected behavior. OperationContext is supposed to be the context one layer above session, and it supposed to accumulate all client faults, even if you start multiple sessions for doing different kinds of validation, so that in the end you can throw all faults as one exception.
One extra thing that probably should be done automatically is clearing client faults in the opContext when you throw them in a validation exception. I will add this line in the next push. For now you can just add opContext.ClientFaults.Clear() in exception handler for one session, if you want to have fresh-start chance with another.