user2491336
user2491336

Reputation: 187

delete entities which are not represented on the server side

I want to remove all entities which are not represented on the server anymore (e.g when another client deletes it).

My current approach is to delete all entities from a specific type which are not returned after a query anymore:

  1. Get and cache all local entities from specific type
  2. Make the query
  3. Compare old entities with new entities which are returned from the query and detach it from entity manager

This seems a little work for me and i wonder if there not an easier way (maybe breeze already has something) to do that?

Upvotes: 0

Views: 403

Answers (1)

Jay Traband
Jay Traband

Reputation: 17052

It's a good question. We refer to these types of entities as "ghosts". They are entities that are queried from a server by one user and later deleted by another user. The entities on the first client have now become 'ghosts'.

We have an existing feature request that would automatically 'detach' these if and only if a primary key requery occurs. The reason for this is that unless the entity was fetched by primary key we cannot determine that it is a ghost. We have not yet implemented this feature but are considering it for one of the near term releases. Would this feature be of use to you?

Upvotes: 2

Related Questions