Component used: WorkManager Version used: WorkManager 2.2.0-alpha02, Room 2.2.0 stable Devices/Android versions reproduced on: seen once in crash reporting on a OnePlus device running Android 10
It seems that PreferenceUtils.setNeedsReschedule() manually calls setTransactionSuccessful(), but where it is called from, ForceStopRunnable.run, doesn't have a transaction running so the app crashes.
Fatal Exception: java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction. at android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:917) at android.database.sqlite.SQLiteSession.setTransactionSuccessful(SQLiteSession.java:373) at android.database.sqlite.SQLiteDatabase.setTransactionSuccessful(SQLiteDatabase.java:618) at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.setTransactionSuccessful(FrameworkSQLiteDatabase.java:95) at androidx.room.RoomDatabase.setTransactionSuccessful(RoomDatabase.java:395) at androidx.work.impl.utils.PreferenceUtils.setNeedsReschedule(PreferenceUtils.java:106) at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:89) at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919)
Description
Version used: WorkManager 2.2.0-alpha02, Room 2.2.0 stable
Devices/Android versions reproduced on: seen once in crash reporting on a OnePlus device running Android 10
It seems that PreferenceUtils.setNeedsReschedule() manually calls setTransactionSuccessful(), but where it is called from, ForceStopRunnable.run, doesn't have a transaction running so the app crashes.
Fatal Exception: java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
at android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:917)
at android.database.sqlite.SQLiteSession.setTransactionSuccessful(SQLiteSession.java:373)
at android.database.sqlite.SQLiteDatabase.setTransactionSuccessful(SQLiteDatabase.java:618)
at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.setTransactionSuccessful(FrameworkSQLiteDatabase.java:95)
at androidx.room.RoomDatabase.setTransactionSuccessful(RoomDatabase.java:395)
at androidx.work.impl.utils.PreferenceUtils.setNeedsReschedule(PreferenceUtils.java:106)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:89)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)