Working with SQL / ADO, got me thinking about something that I think should logically be included with the .net framework, and I was wondering if such a thing exists, let me explain.
Is there an object that is essentially a transaction manager, that you pass commands (work items) to and at the same I would imagine it would be necessary also pass the rollback actions for each work item in the transaction.
For example
Lets say I wanted to perform the following actions:
- Create a folder
- Create a file in this folder
- Perform some other misc tasks like editing reg keys, or really action you can think of that can be rolled back.
Now currently if something fails, I need to manually implement a roll back strategy, so perhaps a way exists to manage these work items as a transaction using oob .net functionality?
My considerations are that it would be asking a lot to have items rollback automatically, but having the ability to manually control what happens during a rollback per work item, seems practical.
Another thing is what Microsoft have done with LINQ is really great, effectively having SQL like queries for all kinds of stuff, not only for SQL tables. So perhaps there is some transaction model with LINQ?
Thanks, if you know of anything like this?