Closed kentfonager closed 6 years ago
@kentfonager Did you check to see that it does work when Studio is not having the file open at the same time?
I only experience this problem, when Studio is open. Otherwise the database is deleted and recreated.
Have you been able to reproduce with my repo?
Problem still exists in 1.18.6. Have you been able to reproduce @bmunkholm ?
Hi Kent, Sorry didn't catch this was reopened. It's expected that you can't have the file open from an application (Studio), delete the file while Studio still has it open and expect that to work. Sorry we can't help with that one.
Goals
When developing on a .Net Core application, I open a local Realm in this way:
I use the "ShouldDeleteIfMigrationNeeded" flag, as this project is under development and models changes very often.
I like to have the same "appcore.realm" local Realm open in Realm Studio at the same time, to kinda "visualize" the content of the Realm. But when I make a change in one of the models in the application and Realm Studio is open at the same time, something goes wrong and I end up with a non existing "appcore.realm" file. Only the "appcore.realm.lock" is still there.
Expected Results
I would expect the local Realm to be deleted and created again with the new models, even though Realm Studio has the "old" Realm open. it should be able to handle that.
Actual Results
The local Realm is deleted, but my applications gets an RealmFileNotFoundException exception, when it tries to open the local Realm. So something goes wrong, when Realm tries to create the new local Realm. Maybe because Realm Studio in some way, still holds a reference to the file?
Steps to Reproduce
Please use my simple test repo and run the solution with Visual Studio for Mac. https://github.com/kentfonager/realmmigration
Code Sample
Version of Realm and Tooling
Logs
systemctl status realm-object-server.service
Paste output here
sudo journalctl -u realm-object-server.service
Paste output here
cat /var/log/realm-object-server.log
Paste output here