Child pages
  • EOF-Using EOF-Deleting

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added missing brackets

...

Code Block
java
java
Person person; /Assume is an EO that exists
EOEditingContext ec = person.editingContext();
ec.deleteObject(person);

try {
  ec.saveChanges();
} catch (Exception e) {
  //something bad happened, the delete didn't occur
  //well don't just stand there, do something about it!
  ec.revert(); // clean up the mess
}

NOTE: These examples assume that correct EOEditingContext locking is occuring, ProjectWonder's ERXEC auto-locking is highly recommended.