processRecentChanges without UndoManager
processRecentChanges without UndoManager
- Subject: processRecentChanges without UndoManager
- From: Christian Pekeler <email@hidden>
- Date: Wed, 3 Nov 2004 10:55:40 -0700
I don't explicitly use an undo manager in my WO project. The
documentation for EOEditingContext.setUndoManager says:
You might invoke this method with null if the application doesn't need
undo and you want to avoid the overhead of an undo stack.
It seems like EOEditingContext is using the undo manager internally,
because if I do this:
editingContext.setUndoManager(null);
UndeletableEntity undeletableEntity = new UndeletableEntity();
editingContext.insertObject(undeletableEntity);
editingContext.deleteObject(undeletableEntity);
editingContext.saveChanges();
with:
public class UndeletableEntity extends EOGenericRecord {
...
public void validateForDelete() throws
NSValidation.ValidationException {
super.validateForDelete();
throw new ValidationException("preventing deletion for testing
purposes");
}
}
I get:
java.lang.IllegalStateException: Editing context needs an undo manager
to recover from delete propagation problems. Do not set the undo
manager of this editing context to null
at
com.webobjects.eocontrol.EOEditingContext._processRecentChanges(EOEditin
gContext.java:1694)
at
com.webobjects.eocontrol.EOEditingContext._prepareForPushChanges(EOEditi
ngContext.java:3179)
at
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.j
ava:3135)
So apparently it is not OK to set the undo manager to null. Am I
misunderstanding something or is this a bug in
EOEditingContext._processRecentChanges()?
Thanks,
Christian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden