Skip to content

Commit

Permalink
Remove duplicates when batch fetching GIDs to avoid killing the DB
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthuss committed Nov 27, 2012
1 parent 1e318ba commit 0172f97
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ public static void batchFetchRelationship(EODatabaseContext databaseContext, EOR
}
}
else {
NSMutableArray<EOGlobalID> gids = new NSMutableArray<EOGlobalID>();
NSMutableSet<EOGlobalID> gids = new NSMutableSet<EOGlobalID>();

NSMutableArray objectsWithUnfaultedRelationships = new NSMutableArray();
EOEntity destinationEntity = relationship.destinationEntity();
Expand Down Expand Up @@ -1887,7 +1887,7 @@ public static void batchFetchRelationship(EODatabaseContext databaseContext, EOR
// fetching of abstract entities very effectively. We instead want to create
// our own GID and batch fetch the GIDs ourselves.
if (gids.count() > 0) {
ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(editingContext, gids, ! skipFaultedRelationships);
ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(editingContext, gids.allObjects(), ! skipFaultedRelationships);
}
}

Expand Down

0 comments on commit 0172f97

Please sign in to comment.