At my current project we are working on a distributed cloud application that will store the state of an entity and the associated events. When a message is recieved from the queue we update the state of an entity in SQL Azure and save the events associated with that update in table storage.
It looks something like this:
- Start UnitOfWork
- Update Entity in SQL Azure
- Save Events to table storage
- Commit transaction
- End UnitOfWork
The problem we are encountering here is that we can't submit the changes in SQL Azure and Table storage within one transaction. So when the saving of the entity in SQL Azure fails, we want to rollback the saving of the events in table storage.
Any help is much appreciated.