• 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: Primary Key update question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Primary Key update question


  • Subject: Re: Primary Key update question
  • From: Alan Ward <email@hidden>
  • Date: Tue, 7 Nov 2006 15:59:45 -0700


The other one that crops up every now and again is when you have some other tool (i.e. not a WOApp)
writing the data and values get into the database with leading or [more commonly] trailing spaces in them.


Alan

On Nov 7, 2006, at 3:38 PM, Chuck Hill wrote:

Hi Chip,

On Nov 7, 2006, at 2:00 PM, Chip Myers wrote:

I'm having trouble with a simple select, edit, and save page that I'm developing. I consistently receive an error which reads something like the following:


java.lang.Illegal.State.Exception: cannot update primary-key from 51 to 51 on object: {values.... etc.....

Is this a common error, and is there a common solution?

It is fairly common, someone complains about it a few times a year. There are a few things to look at:


1. Making a primary or foreign key a class property _may_ cause this to happen. I have several keys that are also class properties and I have not run into this error with them, so it is not a guaranteed source of the error. It probably has to be a class property _and_ used a certain way in a relationship.

2. Using a BigDecimal or other type with a scale that is different when created than when fetched from the database. Care in your code and in the EOModel will avoid this.

3. There was another one, but is has slipped my mind. Something about manipulating relationships, IIRC.


Chuck

--

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:
40apple.com


This email sent to email@hidden

_______________________________________________ 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: 
 >Primary Key update question (From: Chip Myers <email@hidden>)
 >Re: Primary Key update question (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Primary Key update question
  • Next by Date: Flex 2 and WebObjects Integration
  • Previous by thread: Re: Primary Key update question
  • Next by thread: Flex 2 and WebObjects Integration
  • Index(es):
    • Date
    • Thread