Getting a deleted value from realm-java threads

I use realm-java on Android.
now I’m creating profile function, but I’m not sure how to user realm correctly.

when renew profile, delete value -> store value but, I fetch value from realm, sometimes old value is taken.

To reproduce, My test repository is below, and I attached movie that problem is reproduced. https://github.com/shinsan/realm_test/

When thread id is changed, sometimes old value appears. so, if you try to reproduce, please use lower memory device such as nexus5 simulator
Lower Spec AVD is easy to reproduce. such as (Nexus4 or 5 RAM 512MB VM heap 40MB) easy to change process id

#I think Realm instance is singleton and transaction is thread-safe, so value is always only one.

my code kotlin + Android Studio Realm Java 10.3

I solved this, simply I forgot to close realm instance.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.