Ria KeyStateManager problem with updating entity

4 posts, 1 answers
  1. Robert
    Robert avatar
    15 posts
    Member since:
    Aug 2011

    Posted 14 Jan 2013 Link to this post

    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

  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 16 Jan 2013 Link to this post

    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.
  3. DevCraft banner
  4. Robert
    Robert avatar
    15 posts
    Member since:
    Aug 2011

    Posted 18 Feb 2013 Link to this post

    Hello Alexander,

    is there any progress with this issue?

    Thanks for your response
    Robert
  5. Answer
    Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 18 Feb 2013 Link to this post

    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.
Back to Top