https://kotlinlang.org logo
#realm
Title
# realm
b

benkuly

10/12/2023, 3:20 PM
What is the behaviour of realm-kotlin, when an app (Android) is killed while a tranasction is running?
c

Claus Rørbech

10/13/2023, 12:33 PM
Updates to the realm-file are transactional, so either the transaction succeeds or is cancelled/not completed if the process stop. The changes are only written to disk if succeeded: https://www.mongodb.com/docs/realm/sdk/kotlin/realm-database/crud/create/#write-transactions
b

benkuly

10/13/2023, 1:29 PM
So it is absolutely not possible, that a transaction is partly written to disk? (that's what we see in production sometimes, but it may be an issue on our side)
c

Claus Rørbech

10/13/2023, 1:43 PM
No, all changes from the
write
-block will be flushed atomically to the file, but only if the
write
-block terminates gracefully. If you observe unexpected behaviour, please file an issue at https://github.com/realm/realm-kotlin with a description of what you are intending, expecting and the actual result, and then we can try to guide you from that.
thank you color 1