• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EO not getting marked as needing to be updated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: EO not getting marked as needing to be updated
      • From: Greg Hulands <email@hidden>
References: 
 >Re: EO not getting marked as needing to be updated (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: EO not getting marked as needing to be updated
  • Next by Date: Re: Anyone using InnoDB table type with MySQL/WebObjects?
  • Previous by thread: Re: EO not getting marked as needing to be updated
  • Next by thread: Re: EO not getting marked as needing to be updated
  • Index(es):
    • Date
    • Thread