This is a migrated thread and some comments may be shown as answers.

Ria KeyStateManager problem with updating entity

3 Answers 51 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Robert
Top achievements
Rank 1
Robert asked on 14 Jan 2013, 10:10 AM
Hello,
I've got a problem with updating one of my entity, which has joint primary key (two columns with long datatype].
 If I'll change just only one non-primary column value on entity and then saveā€¦

At first I call context.SubmitAndLogChanges
Next steps are gained from call stack and .net reflector:
1. it goes through entity column setter in entity.generated.cs under rlinq
2. it will get into KeyStateManger.StateManager.SetField<long>(PersistenceCapable pc, int field, T currentValue, T newValue)
3. then it will get into KeyStateManager.StoreValue(int key, object v)
4. and finally KV SetValue(int key) is reached where it will run in neverending loop, maybe due to key value is not equal to values.slot.
   
private KV SetValue(int key)
{
    KV values = this.values;
    while (values != null)
    {
        if (values.slot == key)
        {
            return values;
        }
    }
    values = new KV {
        next = this.values,
        slot = key
    };
    this.values = values;
    return values;
}

My other entities will not reach this part of code during the save operation.
I suppose the entity, which causes the problem has OpenAccessEnhancedStateManager != null instead of my other entities. But I don't know why.

public static void OpenAccessEnhancedSet_PRUCHOD_KON(IPOCWV owner, long value)
{
    StateManager openAccessEnhancedStateManager = owner.OpenAccessEnhancedStateManager;
    if (openAccessEnhancedStateManager != null)
    {
        openAccessEnhancedStateManager.SetField<long>(owner, 2 + OpenAccessEnhancedInheritedFieldCount, owner._PRUCHOD_KON, value);
    }
    else
    {
        owner._PRUCHOD_KON = value;
    }
}

Telerik.OpenAccess.Ria.Extensions - version 2012.3.1012.1

Could you please help me with this issue?

Thank you
Robert

3 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 16 Jan 2013, 03:41 PM
Hello Robert,

Your observations seem correct, this loop indeed would not end unless values.slot is equal to the key. The interesting part is that this code is rather old and this behavior has not been reported so far. We will try to reproduce the error and devise the cases when it could occur.

Of course, this will be fixed for the next public build of OpenAccess if it turns out to be a bug, as it looks like. I will let you know our findings in this thread.

All the best,
Alexander
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
0
Robert
Top achievements
Rank 1
answered on 18 Feb 2013, 08:27 AM
Hello Alexander,

is there any progress with this issue?

Thanks for your response
Robert
0
Accepted
Alexander
Telerik team
answered on 18 Feb 2013, 08:53 AM
Hi Robert,

Yes, we have fixed this problem and the fix will be included in the 2013 Q1 release, expected later this week.

Greetings,
Alexander
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
Tags
Databases and Data Types
Asked by
Robert
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Robert
Top achievements
Rank 1
Share this question
or