Fixed
Status Update
Comments
ia...@gmail.com <ia...@gmail.com> #2
There is no error when I use kotlin versions: 1.6.21, but issue/error starts appearing when kotlin version is 1.7.0
yb...@google.com <yb...@google.com>
yb...@google.com <yb...@google.com> #3
I have the same problem, i think no stable version of room 2.4.2 with kotlin 1.7.0
yb...@google.com <yb...@google.com> #4
usage implementation 'androidx.room:room-ktx:2.5.0-alpha02'
ia...@gmail.com <ia...@gmail.com> #5
me too
yb...@google.com <yb...@google.com> #6
Thanks for the report I was able to reproduce the issue and indeed it occurs when using Kotlin 1.7.0. Sadly I don't have a workaround yet, but will investigate further.
ap...@google.com <ap...@google.com> #7
and just to clarify, we see the issue when using Room 2.4.2, but not with Room 2.5.0-alpha02.
ap...@google.com <ap...@google.com> #8
it occurs when kotlin version 1.7.0 and room 2.5.0-alpha02 as well to me. I solved the problem by downgrading kotlin version to 1.6.20
Description
withContext(Dispatchers.Default) {
db.beginTransaction()
db.insert(data) // DAO suspend function
db.update(anotherData) // DAO suspend function
db.setTransactionSuccessful()
db.endTransaction()
}
This can deadlock because transaction are exclusive and are ThreadLocal, meaning once a transaction is started in a thread form the default dispatcher, another coroutine dispatcher thread will get blocked even if we are within the same coroutine.