rolling back a transaction manually [message #816195] |
Thu, 08 March 2012 14:36 |
Sven Krause Messages: 119 Registered: July 2009 |
Senior Member |
|
|
Hi,
how can I rollback an nested transaction programatically?
In detail: I have to have an wizard that is opened during an command
(AbstractEMFOperation) execution. This wizard allows the user entering
some parameters. The wizard creates a sequence of commands (depdendent
on the parameters), executes them and present an review page where the
user might change additional things on the wizard subject (EObject
having various children). The user might step back in the wizard to
change the parameters and step forward again to the result page. What
I'm doing: I'm wrapping the wizard forward processing as list of
AbstractEMFOperations, which I'm undoing, if the user goes back in the
wizard.
The problem happens, if such AbstractEMFOperation has been undone and
the user closes the dialog. In this moment the main command will be
rolled back too, but the changes list might be corrupt and I'm getting
an IndexOutofBoundsException somewhere in the changes applyAndRevert
method. The issues raises because of the sucessful execution of an
EMFOperation merges the changes recorded by the sub transaction into the
enclosing transaction. Finally the sub AbstractEMFOperations are not
really rolled back, independent, if I call undo or not.
Is there a better way to wrap AbstractEMFOperations in a running command
and undo them under own control?
Thanks in advance,
Sven
|
|
|
Powered by
FUDForum. Page generated in 0.02227 seconds