Accessing Unit of Work while committing

Posts   
 
    
Posts: 134
Joined: 04-Mar-2005
# Posted on: 09-Sep-2005 02:32:18   

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? confused

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 09-Sep-2005 09:52:49   

no, what you're doing should be ok. It's strange that the debugger doesn't stop. It doesn't step over the line to the next line but simply exits? The only time I see that, my code is out of sync with the compiled code... could you try a build-all of your solution, updating all assemblies in your bin folder?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 134
Joined: 04-Mar-2005
# Posted on: 09-Sep-2005 17:23:34   

Why is it that I always miss the salient point in my messages? flushed I missed mentioning that the second update and save that was made as a part of the validation was running as an asyncronous process. When I changed it to a regular synchronous call everything worked fine...