This is important to know because SQLite database on Android requires us to create only Single instance of database connector to be used across all the threads. So we usually store such singleton as static variable in some class and access it from everywhere. But if the code executed by alarms and activities are going to run on separate processes, they won't share the same JVM. So each process will create its own singleton. In such case, two or more DB connectors might be simultaneously trying to access the db file. This may result in data corruption or exceptions.
Aucun commentaire:
Enregistrer un commentaire