Re: Error updating row in database
Re: Error updating row in database
- Subject: Re: Error updating row in database
- From: Paul Lynch <email@hidden>
- Date: Tue, 12 Sep 2006 13:51:38 +0100
On 12 Sep 2006, at 13:00, David Griffith wrote:
ec.saveChanges(); >-- saves the record to the database, assigns
the primary key
myEOObject.setAccountNumber(myEOObject.pkID().toString());
ec.saveChanges();
Obviously I am accessing the primary key via an accessor method of
my custom class using the EOUtilities framework.
Anyway, the problem is that occasionally (maybe 10% of the time)
the row fails to update and generates an exception stating 'failed
to update row in database'. Everything is saved fine, the primary
key is assigned, but after the second ec.saveChanges() is where it
fails.
Does anyone have any idea why that might be? Is it perhaps because
it is trying to update the database too quickly after a previous
update?
Guessing: does your eo have another field with the locking property
set? In particular, a time field that could have resolution
problems? If so, make any date fields non-locking.
The general problem is that this breaks relational integrity
(inventing jargon here), but it sounds like an ideal candidate for a
trigger - does MySQL support triggers now? :-)
Paul
_______________________________________________
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