Realm v7.0.0 Release Notes
Release Date: 2020-05-16 // almost 4 years ago-
๐ NOTE: This version bumps the Realm file format to version 10. Files created with previous versions of Realm will be automatically upgraded. It is not possible to downgrade to version 9 or earlier. Only Studio 3.11 or later will be able to open the new file format. ๐ NOTE: This version bumps the Realm file format to version 10. Files created with previous versions of Realm will be automatically upgraded. It is not possible to downgrade to version 9 or earlier. Only Realm Studio 4 or later will be able to open the new file format.
๐ฅ Breaking Changes
- ๐ [ObjectServer] Removed deprecated method
SyncConfiguration.Builder.partialRealm()
. UseSyncConfiguration.Builder.fullSynchronization()
instead. - ๐ [ObjectServer] Removed deprecated methods
SyncConfiguration.automatic()
andSyncConfiguration.automatic(User, Uri)
. UseSyncUser.getDefaultConfiguration()
andSyncUser.createConfiguration(Url)
. - ๐ [ObjectServer] Removed deprecated method
ErrorCode.fromInt(int)
. - ๐ [ObjectServer] Removed deprecated method
SyncCredentials.nickname(name)
andSyncCredentials.nickname(name, isAdmin)
. UseSyncCredentials.usernamePassword(username, password)
instead. - ๐ [ObjectServer] Deprecated state
SyncSession.State.ERROR
has been removed. UseSyncConfiguration.Builder.errorHandler(ErrorHandler)
instead. - ๐ [ObjectServer]
IncompatibleSyncedFileException
is removed as it is no longer used. - ๐ [ObjectServer] New error codes thrown by the underlying sync layers now have proper enum mappings in
ErrorCode.java
. A few other errors have been renamed in order to have consistent naming. (Issue #6387) - ๐ RxJava Flowables and Observables are now subscribed to and unsubscribed to asynchronously on the thread holding the live Realm, instead of previously where this was done synchronously.
- ๐ All RxJava Flowables and Observables now return frozen objects instead of live objects. This can be configured using
RealmConfiguration.Builder.rxFactory(new RealmObservableFactory(true|false))
. By using frozen objects, it is possible to send RealmObjects across threads, which means that all RxJava operators should now be supported without the need to copy Realm data into unmanaged objects. - ๐ MIPS is not supported anymore.
- Realm now requires
minSdkVersion
16. Up from 9. - ๐ [ObjectServer]
IncompatibleSyncedFileException
is removed and no longer thrown.
โจ Enhancements
- โ Added
Realm.freeze()
,RealmObject.freeze()
,RealmResults.freeze()
andRealmList.freeze()
. These methods will return a frozen version of the current Realm data. This data can be read from any thread without throwing anIllegalStateException
, but will never change. All frozen Realms and data can be closed by callingRealm.close()
on the frozen Realm, but fully closing all live Realms will also close the frozen ones. Frozen data can be queried as normal, but trying to mutate it in any way will throw anIllegalStateException
. This includes all methods that attempt to refresh or add change listeners. (Issue #6590) - โ Added
Realm.isFrozen()
,RealmObject.isFrozen()
,RealmObject.isFrozen(RealmModel)
,RealmResults.isFrozen()
andRealmList.isFrozen()
, which returns whether or not the data is frozen. - โ Added
RealmConfiguration.Builder.maxNumberOfActiveVersions(long number)
. Setting this will cause Realm to throw anIllegalStateException
if too many versions of the Realm data are live at the same time. Having too many versions can dramatically increase the filesize of the Realm. - Storing large binary blobs in Realm files no longer forces the file to be at least 8x the size of the largest blob.
- โฌ๏ธ Reduce the size of transaction logs stored inside the Realm file, reducing file size growth from large transactions.
RealmResults.asJSON()
is no longer@Beta
- 0๏ธโฃ The default
toString()
for proxy objects now print the length of binary fields. (Issue #6767)
๐ Fixes
- ๐ If a DynamicRealm and Realm was opened for the same file they would share transaction state by accident. The implication was that writes to a
Realm
would immediately show up in theDynamicRealm
. This has been fixed, so now it is required to callrefresh()
on the other Realm or wait for normal change listeners to detect the change.
Compatibility
- Realm Object Server: 3.23.1 or later.
- Realm Studio: 4.0.0 or later.
- โฌ๏ธ File format: Generates Realms with format v10 (Reads and upgrades all previous formats from Realm Java 2.0 and later).
- ๐ APIs are backwards compatible with all previous release of realm-java in the 7.x.y series.
Internal
OsSharedRealm.VersionID.hashCode()
was not implemented correctly and included the memory location in the hashcode.- โฌ๏ธ OKHttp was upgraded to 3.10.0 from 3.9.0.
- โฌ๏ธ The NDK has been upgraded from r10e to r21.
- The compiler used for C++ code has changed from GCC to Clang.
- โฌ๏ธ OpenSSL used by Realms encryption layer has been upgraded from 1.0.2k to 1.1.1b.
- โก๏ธ Updated to Object Store commit: 820b74e2378f111991877d43068a95d2b7a2e404.
- โก๏ธ Updated to Realm Sync 5.0.3.
- โก๏ธ Updated to Realm Core 6.0.4.
Credits
- ๐ Thanks to @joxon for better support for binary fields in proxy objects.
- ๐ [ObjectServer] Removed deprecated method