• 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: Problems with Stale Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with Stale Data


  • Subject: Re: Problems with Stale Data
  • From: David Avendasora <email@hidden>
  • Date: Mon, 28 Jan 2008 16:48:20 -0500

I also ran into something similar when I had bad data in the database as part of an inheritance hierarchy. A record had been set as the destination, but it wasn't the correct class, so while the record existed in the DB, when WO read the database and filtered it down to only objects of the correct class, then it no longer was there, and couldn't even be updated via WO since the type was part of the DB locking attributes.

To try to say this more clearly, the record was in the DB, but WO couldn't find it to update it or delete it because the subClassTypeId column had a 2 instead of a 1 in it.

The bad data was written by WO originally when the relationship mistakenly pointed to the other subClassType. When I changed the relationship to point to the correct subClassType, then I got this error on anything written by the previous code.

Dave

On Jan 28, 2008, at 3:26 PM, Chuck Hill wrote:


On Jan 28, 2008, at 12:19 PM, Chris Hoyt wrote:

One of my applications has started throwing errors due to stale data. such as:

Error: com.webobjects.eoaccess.EOGeneralAdaptorException exception
Reason:
com.webobjects.eoaccess.EOGeneralAdaptorException: lockRowComparingAttributes -- com.webobjects.jdbcadaptor.JDBCChannel: lock operation failed to select any rows

EOF should not be locking rows at all. That it is indicates a problem in the model, code, or prototypes.



and

java.lang.IllegalStateException: cannot update primary-key 'assignmentID' form '52067' to '52067' on object

What you can't see there is that one of those 52067 is an Integer and one is a Long (or a BigDecimal or some class other than what the first one is.



I have had these problems before and they are always related to old cached data, I have gotten around them in the past with editingContext.refetch(); and now I am trying editingContext.refaultAllObjects();

Is there a better way to force data to refresh?

Those errors are not from state data. Somethings that can cause this:

1. Different value types on the PK and FK side of relationships in the model

2. Incorrect jdbc2info in the connection dictionary

3. Recently fixed bug in FrontBasePlugIn.framework in Wonder that can affect you if you are using Long primary keys.

WO version?  Database?  WebApp?  JavaClient?  Details?

Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40avendasora.com


This email sent to email@hidden



_______________________________________________ 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: 
 >Problems with Stale Data (From: "Chris Hoyt" <email@hidden>)
 >Re: Problems with Stale Data (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Some more concurrency fun
  • Next by Date: Re: Some more concurrency fun
  • Previous by thread: Re: Problems with Stale Data
  • Next by thread: Re: Problems with Stale Data
  • Index(es):
    • Date
    • Thread