2

What happens if two separated threads on the same android application try to access the same table in SQLite database? May I have conflict?

GVillani82
  • 17,196
  • 30
  • 105
  • 172

1 Answers1

3

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)

Community
  • 1
  • 1
zeller
  • 4,904
  • 2
  • 22
  • 40