Skip to content

Wrong behavior when call Reload on PersonalCacheStruct #24

@kybird

Description

@kybird

if you call reload function on PersonalCacheStruct especially entity has ReadWriteDB property

it will re-load data from Database.

and it set value by ReadEntityProperty method in SqlDataReceiver.cs

it call entity's Property function and it fire event NotifyChange event and the value will be added to SyncQueueManager. clearly not expected behavior.

moreover the "ReadEntityProperty" function set value sequencely

each set value fire event and the "not completed setting entity' will be added;

in another word.

if you have some entity like below


[EntityTable]
class someentity
{
    [EntityField(true)]
    public long userID {get;set}
    
    [EntityField(true)]
    public long subkey {get;set}
}

and we have one data from database as below

UserID, subKey
1, 2

now call

PersonalCacheStruct().Reload();

then we will have two DataSyncQueue item

1-0, 1-2

we don't need add this data to DataSyncQueue again. just waste performance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions