I've a function that deletes some objects, but as the SQL data is hierarchical I need a (recursive) helper function that modifies the hierarchy before the deletion.
Both functions register their changes with the
UndoManager and undo/redo works fine.
The only catch is that the initial deletion/modification is done in a single database write (by passing the
Database parameter to the helper function, but the undo/redo is done by several calls from the undo manager, resulting in all separate writes.
Do you have some suggestion on how I can make sure that a multilevel undo/redo is also performed in a single database write?
Maybe there is a way to 'lock' the database for other reads/writes for a longer duration than what
barrierWriteWithoutTransaction gives? If so, I can lock the database on the
NSUndoManagerWillUndoChange and unlock on
Thanks in advance.