You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I never paid too much attention to RealmConfiguration creation in my app but today I want to had compactOnLaunch with callback. And I discover that this callback is called everytime getInstance is used. But if I let one Realm instance without close, the next time I will make getInstance the callback of compactOnLaunch isn't call.
Generally it's better to have 1 realm instance for all and close when the app is close OR 1 realm instance each time we want to read/write on realm and close it immediatly ? (For me the second is better but in that case compactOnLaunch is called everytime.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I never paid too much attention to
RealmConfigurationcreation in my app but today I want to hadcompactOnLaunchwith callback. And I discover that this callback is called everytimegetInstanceis used. But if I let one Realm instance without close, the next time I will makegetInstancethe callback ofcompactOnLaunchisn't call.Generally it's better to have 1 realm instance for all and close when the app is close OR 1 realm instance each time we want to read/write on realm and close it immediatly ?
(For me the second is better but in that case
compactOnLaunchis called everytime.)Can you help me understand this better.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions