Does Realm Offer a Built‑In Retry Wrapper to Prevent Duplicate Writes?
0 reputation · 29 May 2020, 04:37 UTC
Goal: Safely retry a Realm write after a transient failure without creating duplicate persisted records.
Constraints: Realm aborts the transaction on error, primary‑key upserts prevent local duplicates, but Realm Sync may still record separate change entries and transaction‑abort guarantees differ between Core versions and language bindings (Java, Swift, Kotlin, .NET).
Uncertainty: It is unclear whether Realm should provide a built‑in retry wrapper that transparently suppresses write attempts that would not alter the persisted state, or leave this logic to application developers.
Does Realm currently expose a mechanism to automatically deduplicate retried writes?
Which language bindings guarantee transaction abort on all error types?
Should developers rely on primary‑key upsert behavior or implement their own retry wrapper?