Closed liweijieok closed 5 years ago
Hi, I have the same issue with the version:
android.arch.work:work-runtime-ktx:1.0.1
This is my stacktrace:
Fatal Exception: android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5)
at android.database.sqlite.SQLiteConnection.nativeExecute(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.execute + 564(SQLiteConnection.java:564)
at android.database.sqlite.SQLiteSession.beginTransactionUnchecked + 323(SQLiteSession.java:323)
at android.database.sqlite.SQLiteSession.beginTransaction + 298(SQLiteSession.java:298)
at android.database.sqlite.SQLiteDatabase.beginTransaction + 522(SQLiteDatabase.java:522)
at android.database.sqlite.SQLiteDatabase.beginTransaction + 430(SQLiteDatabase.java:430)
at android.arch.persistence.db.framework.FrameworkSQLiteDatabase.beginTransaction + 69(FrameworkSQLiteDatabase.java:69)
at android.arch.persistence.room.RoomDatabase.beginTransaction + 254(RoomDatabase.java:254)
at androidx.work.impl.WorkerWrapper.runWorker + 136(WorkerWrapper.java:136)
at androidx.work.impl.WorkerWrapper.run + 128(WorkerWrapper.java:128)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1112(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 587(ThreadPoolExecutor.java:587)
at java.lang.Thread.run + 818(Thread.java:818)
Thanks for reporting this. I'm closing this issue because this forum is for issues with the codelab.
WorkManager v2.1.x adds supports for on-demand initialization, @liweijieok I suggest that you take a look at this functionality so that you don't have to call initialize(). This is done automatically the first time that you invoke getInstance(Context). The context is used to retrieve the Application Context to get the custom configuration.
@mcatta We fixed some SQLite exception in the latest v2.1.x releases and we updated the Room version by the library to v2.1 (further helping the stability). I suggest that you give a try with this version if you can (WorkManager v2.x is using androidx).
If you think that this is a problem of the WorkManager library, please open a bug on the WorkManager public issue tracker: https://issuetracker.google.com/issues/new?component=409906&template=1094197
Please reopen if you still think this is an issue with the codelab.
question: I have three process in my project and i call follow code in my
application#oncreate
,so the code was executed three times。at the same time, i config follow code in manifest
version:
error msg:
some time has follow error msg: