We have a mobile app that is standardized on Java Realm database 6.0.2 and we are now in the planning phase for upgrading to the latest 10.x version (10.4.0 as of this writing).
We do not use the “sync” or “cloud” capabilities (we are just using Realm as a stand-alone embedded DB for our mobile app).
Outside of pouring through all the release notes and various change logs on GitHub, is there a summary somewhere akin to “so you are upgrading the stand-alone Realm Java DB from 6.x to 10.x, here is what you need to check for”?
I noticed from the notes in the 7.0 release for example, this comment under “Breaking Changes”:
All RxJava Flowables and Observables now return frozen objects instead of live objects.
I am not sure how to interpret this - we do use RxJava 3 in our app (RxAndroid actually), and we do use an instance of a Realm in the non-UI thread aspect to do various DB related activities.
We use RxJava Disposables all over the place to do background work. Here is an example of the pattern we employ:
return Observable.fromCallable(() -> {
try {
Realm realm = InTouchDataMgr.get().getRealm();
try {
<<DO ACTIVITY WITH REALM INSTANCE HERE>>
<< RETURN PROPERLY CONFIGURED OBJ ARRAY>>
} catch (Exception e) {
return new Object[] {-1, new ArrayList<DeviceInfo>()}; // Signals error happened
} finally {
InTouchDataMgr.get().closeRealmSafely(realm);
}
} catch (Exception e) {
return new Object[] {-1, new ArrayList<DeviceInfo>()}; // Signals error happened
}
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new DisposableObserver<Object>() {
@Override
public void onNext(Object o) {
<< DO ACTIVITY ON UI THREAD HERE>>
}
@Override
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
<< ERROR PROCESSING HERE>>
}
@Override
public void onComplete() {
<< COMPLETION PROCESSING HERE>>
}
});
With the new default behavior as of 7.0.0 is this somehow changed under the covers unless we configure it per the release notes?
What other major “gotcha’s” might we run into?