You usually do not need to worry about managing memory in an Enterprise Objects application, but this section may be interesting for advanced users.
EOEditingContexts use weak references to the EOEnterpriseObjects registered with them. EOEnterpriseObjects hold a strong reference to the EOEditingContext in which they are registered. These types of references prevent an EOEditingContext from being garbage collected while an EOEnterpriseObject still requires it. There are several exceptions:
EOEditingContexts hold all inserted, deleted, or updated objects by strong references. These strong references are cleared by the EOEditingContext methods saveChanges, revert, invalidateAllObjects, and reset. They may also be cleared by the EOEditingContext methods invalidateObjectsWithGlobalIDs, refaultObject, refreshObject, undo, and redo, depending on whether the changed state is or is not forcefully discarded.
EOEnterpriseObjects registered with an EOSharedEditingContext are always held by strong references.
You can force an EOEditingContext to hold strong references to all of its EOEnterpriseObjects by invoking either setInstancesRetainRegisteredObjects or setRetainsRegisteredObjects on an editing context in which no enterprise objects are registered.
Last updated: 2007-07-11