• 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
cannot update primary-key error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cannot update primary-key error


  • Subject: cannot update primary-key error
  • From: "Albert Jagnow" <email@hidden>
  • Date: Tue, 15 Feb 2005 17:08:06 -0600
  • Importance: normal
  • Priority: normal

I have an application that has a typical parent to child one to many database relationship. I have no problems creating or saving new parent or child objects. I also have no problems editing existing child objects that are retrieved from the database. But, if I create a new child object and save it then select that object edit it and save again I get the following error on save:

cannot update primary-key 'bkseq' from '89136' to '89136' on object: <object information>...
at com.webobjects.eoaccess.EODatabaseContext._verifyNoChangesToReadonlyEnti ty(EODatabaseContext.java:4886)
at com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseConte xt.java:6355)
at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingCo ntext(EOObjectStoreCoordinator.java:415)
at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.j ava:3165)
at MyComponent.saveChanges(MyComponent.java:138)...


If I restart the application I can edit the object that caused the error, but if I create a new object, save it, edit it, save again I always get the error. For whatever reason WebObjects appears to be trying to update the primary key of the parent object even though I am only making changes to the child object. Any one have any idea what causes this error or how to correct it?

--
Albert Jagnow
Web Developer
The University of Iowa Foundation




_______________________________________________ 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
  • Follow-Ups:
    • Re: cannot update primary-key error
      • From: Chuck Hill <email@hidden>
References: 
 >online store project help needed (From: Kris Holmes <email@hidden>)
 >Re: online store project help needed (From: Dennis Gaastra <email@hidden>)

  • Prev by Date: Re: online store project help needed
  • Next by Date: Custom formatting & validation causes wrong data to be saved
  • Previous by thread: Re: online store project help needed
  • Next by thread: Re: cannot update primary-key error
  • Index(es):
    • Date
    • Thread