• 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: Unable to update or make changes in the table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to update or make changes in the table


  • Subject: Re: Unable to update or make changes in the table
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 9 Feb 2006 10:28:31 -0800


On Feb 9, 2006, at 2:44 AM, .::welemski::. wrote:

Hi,

Is is ok to call "defaultEditingContext" everytime I make a changes in the database?

Because I can no longer make any changes in the database/table everytime I call "saveChanges" method.

I have this code;
Assuming that there is a String varialble name "Fname" and "Lname" in the session.


E_Person person=new E_Person()
EOEditingContex ec=session().defaultEditingContext();
Session session=(Session)session();
NSMutableDictionary criteria=new NSMutableDictionary();
criteria.setObjectForKey(session.Fname,"FName");
criteria.setObjectForKey(session.Lname,"LName");
NSArray searchResult=new NSArray();
searchResult=EOUtilities.objectsMatchingValues (ec,"E_Person",criteria);


if(searchResult.count()>=1){

Is the execution getting to this point? If not, your qualifier is perhaps wrong, there is no data in the database etc.


If it is getting here, but the save not updating the database, check to ensure that you are not violating a commandment:
http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/wa/Main? wikiPage=EOFCommandments


Chuck


   person=(E_Person)searchResult.objectAtIndex(0);
   person.setFName("New Name");
   person.setLName("New Surname");
   ec.saveChanges();
}

the code above will not produce an error but it wont make any changes in the Entity either...


--
 -- -- -- -- -- -- -- -- -- -- --
welemski
 -- -- -- -- -- -- --
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net


This email sent to email@hidden

--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro


Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects




_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Unable to update or make changes in the table (From: ".::welemski::." <email@hidden>)

  • Prev by Date: Re: Sort in memory over multiple fields
  • Next by Date: Re: Sort in memory over multiple fields
  • Previous by thread: Re: Unable to update or make changes in the table
  • Next by thread: Newbie Key Value-coding and Subclasses Question
  • Index(es):
    • Date
    • Thread