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

Re: cannot update primary-key error


  • Subject: Re: cannot update primary-key error
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 16 Feb 2005 11:29:48 -0800

Which database? What data type is the PK? This can sometimes happen with exposed (class property) primary keys. I don't believe this is the root cause as I have some exposed keys and I don't get this error. IIRC, I have also seen this with OpenBase and BigDecimal primary keys when the scale in the created key and the scale in the EOModel did not match.


Chuck


On Feb 15, 2005, at 3:08 PM, Albert Jagnow wrote:

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._verifyNoChangesToReadonlyEnt ity(EODatabaseContext.java:4886)
at com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseCont ext.java:6355)
at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingC ontext(EOObjectStoreCoordinator.java:415)
at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext. java: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:
village.net


This email sent to email@hidden

--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development 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


  • Follow-Ups:
    • Re: cannot update primary-key error
      • From: "Albert Jagnow" <email@hidden>
References: 
 >online store project help needed (From: Kris Holmes <email@hidden>)
 >Re: online store project help needed (From: Dennis Gaastra <email@hidden>)
 >cannot update primary-key error (From: "Albert Jagnow" <email@hidden>)

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