Re: EO not getting marked as needing to be updated
Re: EO not getting marked as needing to be updated
- Subject: Re: EO not getting marked as needing to be updated
- From: Art Isbell <email@hidden>
- Date: Wed, 16 Jun 2004 20:55:16 -1000
On Jun 16, 2004, at 10:31 PM, Greg Hulands wrote:
GiftCertificate cert = null;
try {
cert =
(GiftCertificate)EOUtilities.objectMatchingKeyAndValue(session().defaul
t
EditingContext(), "GiftCertificate", "unlockCode", code);
if (cert != null) {
if (cert.dateRedeemed() != null) {
error = "This Gift Certificate has already been redeemed.";
} else {
cert.setDateRedeemed(new NSTimestamp());
error = "Gift Certificate Redeemed.";
ClientGiftCertificate record = new ClientGiftCertificate();
session().defaultEditingContext().insertObject(record);
record.setBalance(cert.amount());
((Session)session()).user().addObjectToBothSidesOfRelationshipWithKey(r
e
cord, "giftCertificates");
record.addObjectToBothSidesOfRelationshipWithKey(cert,
"giftCertificate");
session().defaultEditingContext().saveChanges();
}
} else {
error = "Invalid Gift Certificate Code.";
}
}
The cert object is the one that doesn't get updated. I have logged the
editing context's updatedObjects and it lists nothing after I set the
date redeemed.
Is GiftCertificate.setDateRedeemed() implemented by invoking
takeStoredValueForKey() which does the change notification?
Have you set a debugger breakpoint at setDateRedeemed() to ensure that
it's being executed?
Does adaptor debugging show the expected fetch, insert, and update?
Maybe it's time to clean and rebuild (the developer's version of
rebooting :-)
Aloha,
Art
_______________________________________________
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.