Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file lock #206

Merged
merged 1 commit into from
Feb 19, 2023
Merged

Fix file lock #206

merged 1 commit into from
Feb 19, 2023

Conversation

pauldendulk
Copy link
Contributor

@pauldendulk pauldendulk commented Feb 19, 2023

The problem

After an mbtiles file was opened, the file was locked and could not be be opened by another application.

The solution

This problem could be solved by replacing the SQLiteConnectionWithLock with SQLiteConnection. The 'Lock' in SQLiteConnectionWithLock does not seem to relate to a file lock by to a connection access lock. Also, that Lock is in a using and should thus be unlocked (and looking at the sql-lite-net source it is unlocked) Nevertheless, replacing it solved the problem. Perhaps there is a bug in the way SQLiteConnectionWithLock is Dispose. Note, SQLiteConnectionWithLock was only used while reading the metadata (which is only once when opening the file) and not while fetching tiles. I don't really see why the lock was needed since everything in the file provider is read only.

@pauldendulk pauldendulk merged commit c95e147 into master Feb 19, 2023
@pauldendulk pauldendulk deleted the feature/fix-file-lock branch February 19, 2023 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant