Error updating row in database
Error updating row in database
- Subject: Error updating row in database
- From: David Griffith <email@hidden>
- Date: Tue, 12 Sep 2006 14:00:26 +0200
Hi all,
Using WO 5.3 with mySQL, I have an entity that has a primary key
(int) and when I save a record in the database, another attribute (of
type String) gets assigned the value of the primary key also.
To do this, I have to first save the record in the database in order
for the primary key to be generated. Then I assign the primary key
value to the other attribute and resave the record.
Something like this:
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?
Kind regards,
David.
_______________________________________________
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