Bug P3
Status Update
Comments
le...@gmail.com <le...@gmail.com> #2
I encountered the same problem in version 2.8.0, but I saw many historical issues marked as duplicates. So in which version was this problem solved? Can the official give the exact version?
My application is multi-process, but I only initialize and use WorkManager in the child process, and also specify setDefaultProcessName as my child process.
However, we still have a certain low probability of this SQLITE_BUSY problem.
I consider
1. Do I need to actively kill the child process after the scheduled start?
2. Currently I have multiple processes, but only RemoteWorkManager is in the child process, and the main process does not do anything. Will the library also cause multi-process problems?
3. I also saw someone try to set busy_timeout, but this is not a fundamental way to solve the problem
My application is multi-process, but I only initialize and use WorkManager in the child process, and also specify setDefaultProcessName as my child process.
However, we still have a certain low probability of this SQLITE_BUSY problem.
I consider
1. Do I need to actively kill the child process after the scheduled start?
2. Currently I have multiple processes, but only RemoteWorkManager is in the child process, and the main process does not do anything. Will the library also cause multi-process problems?
3. I also saw someone try to set busy_timeout, but this is not a fundamental way to solve the problem
Description
Fatal Exception: android.database.sqlite.SQLiteDatabaseLockedException
database is locked (code 5 SQLITE_BUSY)
android.database.sqlite.SQLiteConnection.nativeExecute (SQLiteConnection.java)
android.database.sqlite.SQLiteConnection.execute (SQLiteConnection.java:717)
android.database.sqlite.SQLiteSession.beginTransactionUnchecked (SQLiteSession.java:321)
android.database.sqlite.SQLiteSession.beginTransaction (SQLiteSession.java:300)
android.database.sqlite.SQLiteDatabase.beginTransaction (SQLiteDatabase.java:575)
android.database.sqlite.SQLiteDatabase.beginTransactionNonExclusive (SQLiteDatabase.java:509)
androidx.sqlite.db.framework.FrameworkSQLiteDatabase.beginTransactionNonExclusive (FrameworkSQLiteDatabase.java:74)
androidx.room.RoomDatabase.internalBeginTransaction (RoomDatabase.java:570)
androidx.room.RoomDatabase.beginTransaction (RoomDatabase.java:555)
androidx.work.impl.Schedulers.schedule (Schedulers.java:71)
androidx.work.impl.WorkerWrapper.onWorkFinished (WorkerWrapper.java:375)
androidx.work.impl.WorkerWrapper$2.run (WorkerWrapper.java:331)
androidx.work.impl.utils.SerialExecutor$Task.run (SerialExecutor.java:91)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
java.lang.Thread.run (Thread.java:923)
Component used: androidx.work:work-runtime-ktx
Version used: 2.7.0
Devices/Android versions reproduced on: Oppo, Vivo & Samsung running android 11