Re: Primary Key update question
Re: Primary Key update question
- Subject: Re: Primary Key update question
- From: Chuck Hill <email@hidden>
- Date: Tue, 7 Nov 2006 14:38:42 -0800
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:
This email sent to email@hidden