Re: Snapshots mysteriously vanishing?
Re: Snapshots mysteriously vanishing?
- Subject: Re: Snapshots mysteriously vanishing?
- From: Mike Schrag <email@hidden>
- Date: Fri, 26 Mar 2010 09:35:48 -0400
blah .. @$* final methods. death to them. that's unfortunate. it can still be patched from the EC side, it's just a lot trickier to do. you don't need to file a bug report with apple ... unless it makes you feel good, or something.
On Mar 26, 2010, at 9:17 AM, Brook, James wrote:
> Thanks for the information. I haven't look into the mechanics of how this works before, but I did peak into EOCustomObject's ___setRetainCount. Unfortunately it's a final method.
>
> I guess we can use some sort of home grown method based on something like ERXRetainer, but it makes me feel pretty uncomfortable to be writing our own code to work around a bug as fundamental as this. I would have guessed that nested editing contexts are a widely used feature, so I am surprised I don't here more about the issue. I guess I should file a bug report with Apple. A Wonder workaround would be really nice though!
>
> --
> James
>
> On 25 Mar 2010, at 21:38, Mike Schrag wrote:
>
>> I don't have a patch you can easily apply. The workaround on your side is to not let the EO in the parent EC garbage collect (basically, keep a reference to the parent EO around for any EO that you fault into child EC). There's not an easy recovery from this -- you have to toss your EC stack ... or .. maybe you could refetch the snapshot underneath it, but i think you're probably left with a __retainCount of -1 at that point, so probably even that won't help you.
>>
>> I think this could be fixed pretty easily in wonder by overriding ERXGenericRecord.__setRetainCount .. When count is set >0, call back to your EC and retain the object in a dict and when it drops to 0, release that ref.
>>
>> On Mar 25, 2010, at 4:25 PM, Brook, James wrote:
>>
>>> Mike,
>>>
>>> That sounds all too familiar to me. We are experiencing errors just like that. We have a feature that creates nested editing contexts several levels deep and fetches EOs all the way down to the bottom. Do you know of a workaround, patch or some way to recover from the bug you mention? I seem to remember a similar bug years ago in the days when EOF kept strong references. We are using Wonder.
>>>
>>> Sorry for selfishly jumping in. Disappearing snapshots are causing us lots of pain because whole instances of our application become useless.
>>>
>>> --
>>> James
>>> ________________________________________
>>> From: webobjects-dev-bounces+jbrook=email@hidden [webobjects-dev-bounces+jbrook=email@hidden] On Behalf Of Mike Schrag [email@hidden]
>>> Sent: 25 March 2010 20:20
>>> To: Marc Guenther
>>> Cc: email@hidden
>>> Subject: Re: Snapshots mysteriously vanishing?
>>>
>>>>> by any chance was this an EO in a parent editing context that also existed in a child editingcontext?
>>>>
>>>> I don't think so, but I'm not sure. That particular EO could have been in all differents ECs at the time, as it's entity is used all over the place.
>>>>
>>>> Do you have anything specific in mind?
>>> yeah, there's a bug with refcounting of eo's in child ec's if the parent ec copy of the EO gets garbage collected ... the result of this bug is disappearing snapshots. this specifically applies to eo's fetched into a child that were already fetched into the parent, though, not to peer ec's.
>>>
>>> ms
>>> _______________________________________________
>>> 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