Re: ERD2W and EOGeneralAdaptorException
Re: ERD2W and EOGeneralAdaptorException
- Subject: Re: ERD2W and EOGeneralAdaptorException
- From: Tim Worman <email@hidden>
- Date: Tue, 04 Jun 2013 07:48:54 -0700
Thanks Chuck.
I added this rule to my app. Hopefully that addresses the issue.
100 : (pageConfiguration like 'QueryPerson*' or task = 'queryAll') => refreshesRefetchedObjects = "true" [com.webobjects.directtoweb.Assignment]
Tim
On Jun 3, 2013, at 4:52 PM, Chuck Hill <email@hidden> wrote:
> It does not sound to me like what you are locking on is the problem. It looks like your object store is getting out of sync with the database (this happens when you run multiple instances or something else is writing to the database). To recover from this, you need to re-fetch (refreshing) the object(s) that are causing this problem.
>
> EOGeneralAdaptorException: updateValuesInRowDescribedByQualifier -- er.extensions.jdbc.ERXJDBCAdaptor$Channel method failed to update row in database
> at com.webobjects.eoaccess.EODatabaseContext._exceptionWithDatabaseContextInformationAdded(EODatabaseContext.java:4504)
> ... skipped 1 stack elements
> at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:376)
> at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
> at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:1179)
> at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1102)
> at er.directtoweb.pages.ERD2WInspectPage.tryToSaveChanges(ERD2WInspectPage.java:232)
> at er.directtoweb.pages.ERD2WInspectPage.submitAction(ERD2WInspectPage.java:282)
> at er.modern.look.pages.ERMODInspectPage.submitAction(ERMODInspectPage.java:101)
>
> My WOVNG (aka The Unfinished Framework) presentation from WOWODC a few years back talks about this this.
>
>
> Chuck
>
>
> On 2013-06-03, at 4:17 PM, Tim Worman wrote:
>
>> Thanks Chuck.
>>
>> Well, what has maybe changed is that more of my apps are moving toward using the same PERSON object. Thank you ERXPartial by the way. But maybe that creates collisions.
>>
>> So, if it does become more problematic. What should I lock on? :-) modifyDate seems on the surface to be a pretty good candidate. But, what do others choose if it isn't a good candidate?
>>
>> Tim
>>
>> On Jun 3, 2013, at 3:34 PM, Chuck Hill <email@hidden> wrote:
>>
>>> It depends on your database. If that has not changed recently, then this is probably not the source of your problem. Usually this either works reliably or does not work, also reliably. :-)
>>>
>>>
>>> On 2013-06-03, at 3:21 PM, Tim Worman wrote:
>>>
>>>> David:
>>>>
>>>> I do lock on a last updated attribute (modifyDate) that is a timestamp. I have always done this in all my models - probably since when I was first trained by Apple, that was how our early models were built.
>>>>
>>>> Then modifyDate is always updated by a editing context delegate.
>>>>
>>>> Is this something I should take out? I'm concerned about what could happen after all this time. I do have multiple apps that use the same "Person" entity to make relationships and such so maybe the locking collision is there.
>>>>
>>>> Tim
>>>> UCLA GSE&IS
>>>>
>>>> On Jun 3, 2013, at 3:01 PM, David LeBer <email@hidden> wrote:
>>>>
>>>>> Tim,
>>>>>
>>>>> Have you checked all of the usual suspects for optimistic locking problems in your model?
>>>>>
>>>>> Locking on blobs and timestamps are the two that come to mind.
>>>>>
>>>>> We've run D2W apps in production for ages without these kinds of problems, so it is not a widespread issue that needs an across the board fix.
>>>>>
>>>>> D
>>>>>
>>>>> --
>>>>> David LeBer
>>>>> Codeferous Software
>>>>>
>>>>> On 2013-06-03, at 5:50 PM, Tim Worman <email@hidden> wrote:
>>>>>
>>>>>> Ramsey:
>>>>>>
>>>>>> Thanks much. I'll check out freshness explorer.
>>>>>>
>>>>>> What do you do for D2W typically? Clobber all fetches with a rule and have it always refreshRefetchedObjects for everything or do you typically only put a rule in for certain views and relationships?
>>>>>>
>>>>>> Tim
>>>>>>
>>>>>> On Jun 3, 2013, at 1:19 PM, Ramsey Gurley <email@hidden> wrote:
>>>>>>
>>>>>>>
>>>>>>> On Jun 3, 2013, at 12:06 PM, Tim Worman wrote:
>>>>>>>
>>>>>>>> an optimistic locking problem I believe. If I kick a new instance everything is fine.
>>>>>>>
>>>>>>> That sounds like you need to refreshRefetchedObjects on your fetch spec. If you've previously fetched a row, and then another instance changes that same row, then you fetch the row again in the first instance, the snapshot is not refreshed unless you tell it do so explicitly.
>>>>>>>
>>>>>>> With the default false value for refreshRefetchedObjects, you can actually fetch with a qualifier q, and then filter your fetched array with q in memory and get a smaller array of results.
>>>>>>>
>>>>>>> I suggest playing around with the freshness explorer app for a few minutes. I found the results to be eye opening.
>>>>>>>
>>>>>>> https://github.com/nullterminated/ponder/blob/master/ERR2d2w/Support/FreshnessExplorer.zip
>>>>>>>
>>>>>>> Ramsey
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> 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
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>> --
>>> Chuck Hill
>>> Executive Managing Partner, VP Development and Technical Services
>>>
>>> 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/gvc/practical_webobjects
>>>
>>> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
>>> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>
> --
> Chuck Hill
> Executive Managing Partner, VP Development and Technical Services
>
> 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/gvc/practical_webobjects
>
> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>
>
>
>
>
>
>
>
>
>
>
_______________________________________________
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