Re: Strange error message

Chuck Hill <[email protected]>
Newsgroups gmane.comp.web.webobjects.eof
Organization Global Village Consulting, Inc.
Message-ID <[email protected]>
Ah Ha!  I know the answer.  EOs in an inheritance hierarchy MUST MUST MUST have 
unique primary keys.  That is the only way that EOF can differentiate which 
class an object is.  In your case

RootClass ----> EntityA
           ----> EntityB

No object of EntityA, EntityB (or RootClass if not abstract) can have the same 
PK.   If EOF fetches an instance of EntityA with a PK of 1000, and then fetches 
an instance of EntityB with a PK of 1000 it will think (because the EOGlobalID 
is the same) that the EntityB instance is actually the EntityA instance.


Chuck


Camille Troillard wrote:

> Hi Chuck,
> 
> 
> On Tuesday, Oct 8, 2002, at 19:34 Europe/Paris, Chuck Hill wrote:
> 
>> I've only seen this happen when inheritance was involved which, I 
>> believe, you said was not.  Very strange.
> 
> 
> Yes, it seems like it.
> I didn't explained my problem correctly:
> I actually said that the entities cannot be casted from one to other.  
> But they have the same root class.
> 
> I have posted a message to Jonathan on eof mailing list, that details 
> the steps to reproduce to have the problem.
> You must have received a copy vie the mailing list manager.
> 
> 
> Best Regards,
> Camille
> 
> 
> 
>> Camille Troillard wrote:
>>
>>> Hi Anjo,
>>> First of all, thank you for the help.
>>> On Tuesday, Oct 8, 2002, at 18:51 Europe/Paris, Anjo Krank wrote:
>>>
>>>> This seems like another case of the problem you had with your PKs 
>>>> for the reference entities - for which I also have no explanation?
>>>
>>> I have more infos about my problem:
>>> Here are the steps I did to reproduce something "weird".
>>> 1. Create an "ODAgency" object.
>>> The object has been correctly created in the database (ID: 1000004).
>>> 2. Fetch the "ODAgency" objects.
>>> Only 2 objects, there should be 3.
>>>     A.  I don't see the object I just inserted (though it is in the DB).
>>>     B.  The first one in an ODAgency, the second one is ...  a 
>>> ODAdvertiser !!!!
>>>         With ID, guess what ??? ID: 1000004 (same as the newly 
>>> created advertiser).
>>> The thing is that is seems that EOF gets confused with PK.
>>> If two entities raws have the same PK, then I have a problem.
>>> But I can't tell why ...
>>>
>>>> Can you post that model somewhere?
>>>
>>> For reason you understand, I'll post you the model privately.
>>> If someone is willing to help me no problem, as far as I know to who 
>>> I post the model, then it's ok.
>>> Thanks again,
>>> Camille
>>> _______________________________________________
>>> EOF mailing list
>>> [email protected]
>>> http://www.omnigroup.com/mailman/listinfo/eof
>>
>>
>>
>> -- 
>>
>> Chuck Hill                                 [email protected]
>> Global Village Consulting Inc.             http://www.global-village.net
>>
>>
>>
>> _______________________________________________
>> EOF mailing list
>> [email protected]
>> http://www.omnigroup.com/mailman/listinfo/eof
>>
> 


-- 

Chuck Hill                                 [email protected]
Global Village Consulting Inc.             http://www.global-village.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.