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

Consider using beginTransactionNonExclusive when available #25

Open
Alexander-- opened this issue Jan 15, 2016 · 2 comments
Open

Consider using beginTransactionNonExclusive when available #25

Alexander-- opened this issue Jan 15, 2016 · 2 comments

Comments

@Alexander--
Copy link

I have encountered a nasty deadlock during debugging some db-related code and traced it down to this thread. So, basically, SQLite is advertised as a multiple-readers-single-writer db, but does not work that way in Android, unless you call beginTransactionNonExclusive instead if beginTransaction. The notifications about changes are delivered in order via ContentResolver, so there should not be any concurrency issues from the first glance.

What possible downsides to doing that can you imagine? Would it make sense to use that method by default in AnnotatedSQL?

@hamsterksu
Copy link
Owner

the main idea was - lock for write and allow read always.
in this case UI can load data from database during write process and reload it again when it will be finished.

https://www.sqlite.org/lang_transaction.html

@hamsterksu
Copy link
Owner

maybe it should be configurable option

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

No branches or pull requests

2 participants