dimanche 6 mars 2016

Is there a way to have a temporary data store?

I need to do a bunch of model manipulation as a series of operations that can individually fail, but I want to make the entire manipulations atomic: if any of those operations fail, I want the data store to be left untouched, as it was before the operation. If they all succeed, I want the data store to reflect the new state.

With CoreData (iOS/Mac), I am used to doing this by creating a child NSManagedObjectContext and performing my updates in this child context. If manipulation operations succeed, I save the child context to propagate the updates into the main context. If not, I simply discard the child context.

Is there any similar mechanism available in Ember Data?




Aucun commentaire:

Enregistrer un commentaire