I have a UnitOfWork2 object which I cache until such time a commit is called. As part of the commit the validation (entity-level) happens and as part of this validation I'm updating another entity. I then issue a save on that entity which attempts to retrieve the cached UnitOfWork object, adds to the UoW, and then commits.
The strangeness that I'm seeing is on the retrieval of the UoW. When stepping through code with the debugger I attempt to execute the following line for the commit of the second entity:
Dim uow As MyUnitOfWork = CType(HttpContext.Current.Session("uow"), MyUnitOfWork)
the debugger acts as though I pressed 'go' and executes the rest of the code without stopping. The initial commit that I was part way through excutes ok, however the second commit appears to be discarded. No exception is thrown.
Am I violating something by attempting to create and commit a new UoW while in the process of committing another?