DEV Community 👩‍💻👨‍💻

Cover image for Sqlite Lock
Ali sami hakemy
Ali sami hakemy

Posted on

Sqlite Lock

How To avoid sqlite database lock ?

  • keep singleInstance for DatabaseHelper if you decieded to use multiple thread in your application -make this instance is synchronized to avoid race condition

because use multiple instance for database causes database lock because
you may try two write multiple time at same time this also happens when use multiple thread without synchronized

Image description

Top comments (0)

🌚 Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.