close

abstract fun close()

Close this realm and all underlying resources. Accessing any methods or Realm Objects after this method has been called will then an IllegalStateException.

This will block until underlying Realms (writer and notifier) are closed, including rolling back any ongoing transactions when close is called. Calling this from the Realm Write Dispatcher while inside a transaction block will throw, while calling this by some means of a blocking operation on another thread (e.g. runBlocking(Dispatcher.Default)) inside a transaction cause a deadlock.

Throws

if called from the Realm Write Dispatcher while inside a transaction block.