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 sqlite database is locked #1523

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Fix sqlite database is locked #1523

merged 1 commit into from
Sep 16, 2024

Conversation

yhliyr
Copy link
Contributor

@yhliyr yhliyr commented Sep 12, 2024

If a record already exists in the db messages table, then it first executes the delete sql but does not commit yet, then starts another SQLiteEventStorage instance at #tb_gateway_remote_configurator.py:346 i.e., another sqlite database connection, and again executes the the same delete sql, so the result is a locked database exception.

This exception can be avoided by adding either self.db.commit() or self._gateway._event_storage.stop().

image

I think this could also solve this issue: #1446 (comment)

If a record already exists in the db messages table, then it first executes the delete sql but does not commit yet, then starts another SQLiteEventStorage instance at tb_gateway_remote_configurator.py:346, i.e., another sqlite database connection, and again executes the the same delete sql, so the result is a locked database exception.
@CLAassistant
Copy link

CLAassistant commented Sep 12, 2024

CLA assistant check
All committers have signed the CLA.

@samson0v samson0v linked an issue Sep 13, 2024 that may be closed by this pull request
@imbeacon imbeacon merged commit abbcf14 into thingsboard:master Sep 16, 2024
3 checks passed
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.

[BUG] Storage: Database is locked
3 participants