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

Re: Error updating row in database


  • Subject: Re: Error updating row in database
  • From: Paul Lynch <email@hidden>
  • Date: Tue, 12 Sep 2006 18:19:17 +0100

On 12 Sep 2006, at 17:32, David Griffith wrote:

Yes there is indeed a date field with locking switched on. Not deliberately, but it was like that by default and I didn't change it. I don't see how it affect referential integrity but I'll give it a go :-)

Not referential integrity - that means something different, hence my "inventing jargon". I also don't know for sure if MySQL suffers from this problem, but it's worth a try. The error message is given when an optimistic locking failure occurs, hence my suggestion.


Paul


On 12 Sep 2006, at 14:51, Paul Lynch wrote:

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? :-)

_______________________________________________ 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: 
 >Error updating row in database (From: David Griffith <email@hidden>)
 >Re: Error updating row in database (From: Paul Lynch <email@hidden>)
 >Re: Error updating row in database (From: David Griffith <email@hidden>)

  • Prev by Date: Re: Error updating row in database
  • Next by Date: session timeouts
  • Previous by thread: Re: Error updating row in database
  • Next by thread: Re: Error updating row in database
  • Index(es):
    • Date
    • Thread