Status Update
Comments
sk...@gmail.com <sk...@gmail.com> #2
This happens when blocking thread interrupted.
Use case: RxJava, When switchMap is upstream, downstream blocking operation will be interrupted.
In older version room, runInTransaction is not interruptible, never throws exception like this.
yb...@google.com <yb...@google.com> #3
We updated Room internals to Coroutines and one of the improvements is interruption. Before the internal changes, Room would ignore thread interruption, database operations where not really cancellable, but in the latest version and due to Coroutines, Room can be interrupted but since it has to return some value which it couldn't compute it then throws InterruptedException
as part of the runBlocking
used to bridge blocking DAO functions with Coroutine internals. I think you will need to handle the exception as any other and determine what to return or ignore since Room can't make that decision for you.
yb...@google.com <yb...@google.com> #4
That's a big change.
I think some method should be marked with @Throws(InterruptedException::class)
like runBlocking.
sk...@gmail.com <sk...@gmail.com> #5
runBlocking used to bridge blocking DAO functions with Coroutine internals
It seems that all non-suspend DAO query function are throws InterruptedException
.
Huge migration.
Description
Version used: 1.1.0-alpha1
Devices/Android versions reproduced on: Compiled with API 27
This worked with Room 1.0.0, but now fails probably because it doesn't look past the first constructor when searching for one to use.
```
data class MyComplexClass @JvmOverloads constructor(
@field:Relation(parentColumn = "uid", entityColumn = "uid", entity = OtherThing::class)
var otherThings: Set<OtherThing> = setOf(),
@field:Embedded
val mainThing: MainThing)
```
Now it fails the build with `Error:(70, 2) error: Fields annotated with @Relation cannot be constructor parameters. These values are fetched after the object is constructed.` even though there is a valid constructor that only accepts a `MainThing` object and a valid setter that sets the `@Relation` field.