What happens if two separated threads on the same android application try to access the same table in SQLite database? May I have conflict?
4
-
Please make your question more clear by posting code snippets.Rajesh Rajaram– Rajesh Rajaram2012-09-13 13:34:58 +00:00Commented Sep 13, 2012 at 13:34
-
2Not an exact duplicate, but this may well answer your question: stackoverflow.com/questions/6675240/…Egor– Egor2012-09-13 13:35:19 +00:00Commented Sep 13, 2012 at 13:35
-
Please be clear . Provide more details.URAndroid– URAndroid2012-09-13 13:46:50 +00:00Commented Sep 13, 2012 at 13:46
-
1This question may also be helpful: stackoverflow.com/questions/2493331/…wsanville– wsanville2012-09-13 13:54:44 +00:00Commented Sep 13, 2012 at 13:54
Add a comment
|
1 Answer
The SQLite faq states, that SQLite is thread safe with some (important) caveats. One point above it also states, that concurrent writes are prohibited even from multiple processes, and the write lock is file level. A similar question: Locking a row with SQLite (read lock ?) with a similar answer.
EDIT:
Don't want to steal from others, but the accepted answer in wsanville's question also answers your question perfectly... What are the best practices for SQLite on Android? (copied just in case if the comment's got deleted)