• 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: Update & Delete of an Enterprise Object causes EOEditingContext.saveChanges() to Exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update & Delete of an Enterprise Object causes EOEditingContext.saveChanges() to Exception


  • Subject: Re: Update & Delete of an Enterprise Object causes EOEditingContext.saveChanges() to Exception
  • From: Guido Neitzer <email@hidden>
  • Date: Thu, 6 Nov 2008 10:21:10 -0700

On 06.11.2008, at 08:13, Tim Kitchener wrote:

OS X 10.5.5
WebObjects 5.4.3
MySQL 5.1.26-rc - DB Storage Engine MyISAM
Java 1.5.0_16

I'm hoping that this is a fairly simple database/object model inconsistency - I've spent an alarming amount of time scratching my head, trying different things and trawling the 'net looking for a solution so any assistance or advice you can provide will be more than appreciated.

Any update or delete of any Enterprise Object in my model exceptions when I call saveChages() on my EOEditingContext.  Initially I received a 'lock operation locked more than one row' exception - I have checked that I've not got anything crazy going on like two rows with the same primary key.  Have tried taking taking optimistic locking off of the object's attributes I now get a 'qualifier may not be null' error.

Please help!  Any suggestions as what could be causing this or tips to troubleshoot this better are welcomed.


Sample Code to Recreate Exceptions: 
{
Session session = (Session) session();
EOEditingContext ec = session.defaultEditingContext();

DbTest dbObj = (DbTest) EOUtilities.objectMatchingKeyAndValue (ec, "Test", "priKey", 0);

dbObj.setFreeText("why does this not work - ARGH!");
ec.saveChanges(); /* This line throws the exception */
}

Console - With Optimistic Locking:
[2008-11-6 14:53:51 GMT] <WorkerThread0> <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
com.webobjects.eoaccess.EOGeneralAdaptorException: lockRowComparingAttributes -- com.webobjects.jdbcadaptor.JDBCChannel: lock operation locked more than one row

It seems, that your table is messed up and the primary key attribute that WebObjects uses is not unique. Or the editing context is messed up. Or the pk generation is messed up.

Btw: MyISAM is about the worst idea to use ever. It cannot properly roll back. Use InnoDB (for everything) and the problem will likely just disappear. 

cug
 _______________________________________________
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: 
 >Update & Delete of an Enterprise Object causes EOEditingContext.saveChanges() to Exception (From: Tim Kitchener <email@hidden>)

  • Prev by Date: Re: Lots of EOs slow down the performance
  • Next by Date: Re: Lots of EOs slow down the performance
  • Previous by thread: Re: Update & Delete of an Enterprise Object causes EOEditingContext.saveChanges() to Exception
  • Next by thread: Re: Update & Delete of an Enterprise Object causes EOEditingContext.saveChanges() to Exception
  • Index(es):
    • Date
    • Thread