refaultObject( this )
refaultObject( this )
- Subject: refaultObject( this )
- From: Kent Harris <email@hidden>
- Date: Tue, 27 Apr 2004 11:30:43 -0700
Can one invoke refaultObject() on "this"?
I have a complex optimistic locking failure recovery system wherein
many EO's implement their own recovery mechanisms. The try/catch block
around the saveChanges, upon receiving an optimistic locking failure,
will under certain circumstances invoke a method (defined in an
abstract class that extends EOGenericRecord and is overridden in the
appropriate EO classes) similar to:
failedEO.optimisticLockingFailure( EOAdaptorOperation adaptorOperation
);
wherein the above method does something similar to:
NSMutableDictionary valuesInFailedSave =
adaptorOperation.changedValues();
NSDictionary changes = changesFromSnapshot(
editingContext().committedSnapshotForObject( this ) );
at which point I want to re-fault "this" and reapply only certain
attributes to the re-faulted object before saving changes once again
(effectively a last write wins but I have carefully chosen which
attributes are kept from the modified database entity and which are
kept from the editing-context's updated entity.)
editingContext().refaultObject( this );
... selectively apply newly calculated values based on the contents of
"valuesInFailedSave" and "changes" to "this".
Will "this" be a different reference before versus after the re-fault?
Do I need to work with globalID's before and after the re-fault ? Will
that even work?
- Kent
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.