• 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
Error updating row in database
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Error updating row in database
      • From: Alexander Spohr <email@hidden>
    • Re: Error updating row in database
      • From: Paul Lynch <email@hidden>
  • Prev by Date: Re: Moving Classes into a package
  • Next by Date: Re: Error updating row in database
  • Previous by thread: Utility to move files into database
  • Next by thread: Re: Error updating row in database
  • Index(es):
    • Date
    • Thread