Closed Zhuinden closed 4 years ago
I might be looking for this, but I have lots of issues on 7.0.0 compared to 6.1.0...
@ganfra what kind of issues?
Mostly crashes
@ganfra anything specific, or native crashes? :confused:
Both :D
How many objects are you trying to show from Realm between the threads?
If it's over 10000 objects then I'll write the code... today or tomorrow.
Although I sincerely doubt it'll help with the native crashes. Seriously, Core 10 just doesn't come fast enough.
Yes I do not ask that for fixing crashes, waiting for realm to release something not buggy... Anyway, transactions and reading are getting so slow when having lots of objects in db (more than 75000) and lots of listeners, a bit disappointed by this.
75000? yeah, I'll figure this out, then. You are looking for frozen results.
This library hasn't been updated in 1.5 years and is still using android.arch.*
and support lib v27?
Ugh... :sweat_smile: Anyway, you'll see when it's updated.
Actually I'm not retrieving 75000 directly, I was just pointing that realm is getting slow when the database is growing a lot, no regard with Monarchy :) But yes, if you have time to make some updates, I'll appreciate!
Initial AndroidX migration is done: https://github.com/Zhuinden/realm-monarchy/commit/0ad10fa5703439982c65318f80397aed6ece7fc4
Frozen Results support will come in next commit if all goes well.
06-25 20:31:41.216 4805-4844/? A/art: art/runtime/runtime.cc:366] Pending exception java.lang.UnsupportedOperationException: 'freeze()' is not supported by OrderedRealmCollectionSnapshot. Call 'freeze()' on the original 'RealmCollection' instead.
06-25 20:31:41.216 4805-4844/? A/art: art/runtime/runtime.cc:366] at java.lang.UnsupportedOperationException io.realm.OrderedRealmCollectionSnapshot.getUnsupportedException(java.lang.String) (OrderedRealmCollectionSnapshot.java:133)
06-25 20:31:41.216 4805-4844/? A/art: art/runtime/runtime.cc:366] at io.realm.OrderedRealmCollection io.realm.OrderedRealmCollectionSnapshot.freeze() (OrderedRealmCollectionSnapshot.java:168)
06-25 20:31:41.217 4805-4844/? A/art: art/runtime/runtime.cc:366] at io.realm.RealmCollection io.realm.OrderedRealmCollectionSnapshot.freeze() (OrderedRealmCollectionSnapshot.java:51)
06-25 20:31:41.217 4805-4844/? A/art: art/runtime/runtime.cc:366] at void com.zhuinden.monarchy.FrozenLiveResults.updateResults(io.realm.OrderedRealmCollection) (FrozenLiveResults.java:47)
06-25 20:31:41.217 4805-4844/? A/art: art/runtime/runtime.cc:366] at void com.zhuinden.monarchy.Monarchy$3.onChange(io.realm.RealmResults) (Monarchy.java:202)
06-25 20:31:41.217 4805-4844/? A/art: art/runtime/runtime.cc:366] at void com.zhuinden.monarchy.Monarchy$3.onChange(java.lang.Object) (Monarchy.java:199)
06-25 20:31:41.217 4805-4844/? A/art: art/runtime/runtime.cc:366] at void io.realm.internal.ObservableCollection$RealmChangeListenerWrapper.onChange(java.lang.Object, io.realm.OrderedCollectionChangeSet) (ObservableCollection.java:39)
How cute. :smirk:
Released in 0.7.1.
Theoretically Jitpack should know about it, so it should be available soon.
https://github.com/Zhuinden/realm-monarchy/releases/tag/0.7.1
https://github.com/Zhuinden/realm-monarchy/commit/32369e5025510dffd3d5cebb65f293b25f7b2e89
Check if it makes your DB reads a bit saner. Report back if you experience crashes or whatnot, theoretically you shouldn't. Then again, theoretically Realm should have no native crashes. :smirk:
Thanks for that! I already added my comment to an existant issue on realm repo about crashes on 7.0.0
Report back if frozen results helped, theoretically I think out of all the things that Monarchy offers (copied, paged, frozen), frozen should be the fastest.
I also think what Monarchy offers is actually something that Realm should be able to do out of the box, but that's a different line of thought.
I mostly use mapped as I expose model through a SDK, but I still need it for some cases. But I wait for the crashes to be solved first ;)
With Realm-Java 7.0.0, now it's possible to expose frozen results instead of copied results from the background looper thread.
On the other hand, even though it's simple, I don't feel like writing the code.
If anyone actually wants it, I might.