flushableObjects.addObjectsFromArray(ec.insertedObjects()); flushableObjects.addObjectsFromArray(ec.updatedObjects());
flushableObjects.addObjectsFromArray(insertedObjects); flushableObjects.addObjectsFromArray(updatedObjects);
        public void editingContextDidSaveChanges(NSNotification n) {            EOEditingContext ec = (EOEditingContext) n.object();            final boolean isNestedEditingContext = ! (ec.parentObjectStore() instanceof EOObjectStoreCoordinator);            ERXEnterpriseObject.DidUpdateProcessor.perform(ec, ec.updatedObjects());            ERXEnterpriseObject.DidDeleteProcessor.perform(ec, ec.deletedObjects());            ERXEnterpriseObject.DidInsertProcessor.perform(ec, ec.insertedObjects());            if ( isNestedEditingContext ) {                // we can assume insertedObjectGIDs and updatedObjectGIDs are non null.  if we execute this branch, they're at                // least empty arrays.                final EOEditingContext parentEC = (EOEditingContext)ec.parentObjectStore();                if (ec.insertedObjects().count() > 0 || ec.updatedObjects().count() > 0) {                    NSMutableArray flushableObjects = new NSMutableArray();                    flushableObjects.addObjectsFromArray(ec.insertedObjects());                    flushableObjects.addObjectsFromArray(ec.updatedObjects());                    parentEC.lock();                    try {                        final NSArray flushableObjectsInParent = ERXEOControlUtilities.localInstancesOfObjects(parentEC, flushableObjects);                        if ( log.isDebugEnabled() ) {                            log.debug("saveChanges: before save to child context " + ec +                                    ", need to flush caches on objects in parent context " + parentEC + ": " + flushableObjectsInParent);                        }                        ERXEnterpriseObject.FlushCachesProcessor.perform(parentEC, flushableObjectsInParent);                    } finally {                        parentEC.unlock();                    }                }            }        }