• 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: method failed to update row
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: method failed to update row


  • Subject: Re: method failed to update row
  • From: Robert Walker <email@hidden>
  • Date: Fri, 19 May 2006 16:30:25 -0400

Take a look at "Update Strategies > Recovery" in the following document:

http://developer.apple.com/documentation/WebObjects/ Enterprise_Objects/index.html

This gives a couple of solutions to these "Optimistic Locking" exceptions, including some sample code (note that there may be some errors in the sample code, but I think they are pretty easy to find and fix).

On May 19, 2006, at 4:02 PM, Wolfram Stebel wrote:

Hi List,

another problem i encounter today:

i have two WO applications running, one uses objects from a
sharedEditingContext for display only.
In one method of this appication i added the following:

...
EOEditingContext localEC = new EOEditingContext ();
localEC.setSharedEditingContext ( null );
// wcSponsor comes in a shared EC so get a modifyable copy in local EC
WCSponsor copiedSponsor = ( WCSponsor ) localEC.faultForGlobalID (
wcSponsor.editingContext ().globalIDForObject ( wcSponsor ), localEC );


Integer hc = ( Integer ) copiedSponsor.hit_count();
copiedSponsor.setHit_count ( new Integer ( hc != null ? hc.intValue () + 1 :
1 ) );
localEC.saveChanges ();
...



I get the following exception, when i try to save the same object from the
second application after the above code updated the database:


com.webobjects.eoaccess.EOGeneralAdaptorException:
updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in
database

As far as i can see, this is a standard concurrency problem.
Now i tried TolerantSaver from dneumann to get the data merged and saved.
But now i wonder, that this exception is not catched in there.


Is TolerantSaver the wrong solution?

What could i do instead?

Wolfram


_______________________________________________
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: method failed to update row
      • From: Wolfram Stebel <email@hidden>
References: 
 >method failed to update row (From: Wolfram Stebel <email@hidden>)

  • Prev by Date: method failed to update row
  • Next by Date: Re: AJAX WebObjects Integration
  • Previous by thread: method failed to update row
  • Next by thread: Re: method failed to update row
  • Index(es):
    • Date
    • Thread