Message 1 of 2
Undoing Child Transactions? IV2008
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Working on an addin that presents a form to the user and allows multiple selections for changing items, at one point I added a button to "Undo Last" which I had working fine at one point.
I decided at a later time that I would like to add a "Cancel" button that would dismiss the form AND undo ALL the changes made during the form's "session". At first I thought I could just set a CheckPoint using the transaction manager, but that threw an exception until I added code to start a "main" transaction. Once I did that, that portion using the Checkpoint worked and I was able to undo the whole session now, BUT...
then when I went to test the "Undo Last" button, that threw an exception, so I decided to add (Start/End) my own child transactions hoping that would allow me to undo those separately while also still giving me the option to completely undo the main parent transaction. But it still throws an exception!
So I am wondering, is this child transaction have the capability to undo single portions, or should I look instead at setting multiple Checkpoints to go back to (if that is possible?)
Bob
I decided at a later time that I would like to add a "Cancel" button that would dismiss the form AND undo ALL the changes made during the form's "session". At first I thought I could just set a CheckPoint using the transaction manager, but that threw an exception until I added code to start a "main" transaction. Once I did that, that portion using the Checkpoint worked and I was able to undo the whole session now, BUT...
then when I went to test the "Undo Last" button, that threw an exception, so I decided to add (Start/End) my own child transactions hoping that would allow me to undo those separately while also still giving me the option to completely undo the main parent transaction. But it still throws an exception!
So I am wondering, is this child transaction have the capability to undo single portions, or should I look instead at setting multiple Checkpoints to go back to (if that is possible?)
Bob