You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Andrey Razumovsky <ra...@gmail.com> on 2009/07/10 10:36:02 UTC

Re: Circle references

//dev
There is no cycle between CDO, but there is cycle in DataMap between
DbEntities. AshwoodEntitySorter sorts entities that were changed, not data
objects. For entities in same circle comparison result is zero

2009/7/10 Andrus Adamchik <an...@objectstyle.org>

> Let me see if I get this right... In this example there is obviously no
> closed cycle. So you are saying AshwoodEntitySorter still assumes there is
> one, and gives up on ordering? Then this is a bug.
>
> Andrus
>
>
>
> On Jul 10, 2009, at 11:20 AM, Andrey Razumovsky wrote:
>
>  Imagine references avaliable A->B->C->A
>>
>> 1. Create dependant entity B
>> 2. Create master entity A
>> 3. b.setA(a)
>> 4. Commit.
>>
>> C is even never used.
>>
>
>

Re: Circle references

Posted by Andrus Adamchik <an...@objectstyle.org>.
I didn't write this code, but I recall there is at least an attempt  
there to order objects of the same type to address a resolvable cycle  
like the one you've mentioned. Not sure what the limitations are... 1  
step cycle maybe (a parent-child relationship to self), but I really  
have no idea without looking at the code.

Andrus


On Jul 10, 2009, at 11:47 AM, Andrey Razumovsky wrote:

> It is possible to handle the incomplete circle situation, but in  
> case of
> complete circle it becomes very very tricky. Imagine situation
> A1->B->C->A2
> The correct (and only) insert order is A2, C, B, A1. But Cayenne can  
> never
> support this currently, because it is insering all records of one  
> entity at
> once (?).
>
> 2009/7/10 Andrus Adamchik <an...@objectstyle.org>
>
>> Ok, so seems like my understanding is matching yours. Looks like a  
>> bug.
>>
>> Andrus
>>
>>
>> On Jul 10, 2009, at 11:36 AM, Andrey Razumovsky wrote:
>>
>> //dev
>>> There is no cycle between CDO, but there is cycle in DataMap between
>>> DbEntities. AshwoodEntitySorter sorts entities that were changed,  
>>> not data
>>> objects. For entities in same circle comparison result is zero
>>>
>>> 2009/7/10 Andrus Adamchik <an...@objectstyle.org>
>>>
>>> Let me see if I get this right... In this example there is  
>>> obviously no
>>>> closed cycle. So you are saying AshwoodEntitySorter still assumes  
>>>> there
>>>> is
>>>> one, and gives up on ordering? Then this is a bug.
>>>>
>>>> Andrus
>>>>
>>>>
>>>>
>>>> On Jul 10, 2009, at 11:20 AM, Andrey Razumovsky wrote:
>>>>
>>>> Imagine references avaliable A->B->C->A
>>>>
>>>>>
>>>>> 1. Create dependant entity B
>>>>> 2. Create master entity A
>>>>> 3. b.setA(a)
>>>>> 4. Commit.
>>>>>
>>>>> C is even never used.
>>>>>
>>>>>
>>>>
>>>>
>>


Re: Circle references

Posted by Andrey Razumovsky <ra...@gmail.com>.
It is possible to handle the incomplete circle situation, but in case of
complete circle it becomes very very tricky. Imagine situation
A1->B->C->A2
The correct (and only) insert order is A2, C, B, A1. But Cayenne can never
support this currently, because it is insering all records of one entity at
once (?).

2009/7/10 Andrus Adamchik <an...@objectstyle.org>

> Ok, so seems like my understanding is matching yours. Looks like a bug.
>
> Andrus
>
>
> On Jul 10, 2009, at 11:36 AM, Andrey Razumovsky wrote:
>
>  //dev
>> There is no cycle between CDO, but there is cycle in DataMap between
>> DbEntities. AshwoodEntitySorter sorts entities that were changed, not data
>> objects. For entities in same circle comparison result is zero
>>
>> 2009/7/10 Andrus Adamchik <an...@objectstyle.org>
>>
>>  Let me see if I get this right... In this example there is obviously no
>>> closed cycle. So you are saying AshwoodEntitySorter still assumes there
>>> is
>>> one, and gives up on ordering? Then this is a bug.
>>>
>>> Andrus
>>>
>>>
>>>
>>> On Jul 10, 2009, at 11:20 AM, Andrey Razumovsky wrote:
>>>
>>> Imagine references avaliable A->B->C->A
>>>
>>>>
>>>> 1. Create dependant entity B
>>>> 2. Create master entity A
>>>> 3. b.setA(a)
>>>> 4. Commit.
>>>>
>>>> C is even never used.
>>>>
>>>>
>>>
>>>
>

Re: Circle references

Posted by Andrus Adamchik <an...@objectstyle.org>.
Ok, so seems like my understanding is matching yours. Looks like a bug.

Andrus

On Jul 10, 2009, at 11:36 AM, Andrey Razumovsky wrote:

> //dev
> There is no cycle between CDO, but there is cycle in DataMap between
> DbEntities. AshwoodEntitySorter sorts entities that were changed,  
> not data
> objects. For entities in same circle comparison result is zero
>
> 2009/7/10 Andrus Adamchik <an...@objectstyle.org>
>
>> Let me see if I get this right... In this example there is  
>> obviously no
>> closed cycle. So you are saying AshwoodEntitySorter still assumes  
>> there is
>> one, and gives up on ordering? Then this is a bug.
>>
>> Andrus
>>
>>
>>
>> On Jul 10, 2009, at 11:20 AM, Andrey Razumovsky wrote:
>>
>> Imagine references avaliable A->B->C->A
>>>
>>> 1. Create dependant entity B
>>> 2. Create master entity A
>>> 3. b.setA(a)
>>> 4. Commit.
>>>
>>> C is even never used.
>>>
>>
>>