Status Update
Comments
sb...@google.com <sb...@google.com>
pl...@acculynx.com <pl...@acculynx.com> #3
Hi there - could you provide more context on the issue & a sample project to reproduce? Database locked exceptions are quite difficult to pinpoint without a repro project. Thanks!
de...@gmail.com <de...@gmail.com> #4
Hi. It is reproduceable on some users by using this code:
suspend fun <R> MyDatabase.workaroundWithTransaction(block: suspend TransactionScope<R>.() -> R) {
useWriterConnection {
it.immediateTransaction(block)
}
// TODO: Temporally fix https://issuetracker.google.com/issues/340606803#comment2
// Manually triggers invalidation
invalidationTracker.refreshAsync()
}
wo...@woutervandijke.nl <wo...@woutervandijke.nl> #6
Hi. Please merge the pull request. This is big problem!
sb...@google.com <sb...@google.com>
da...@gmail.com <da...@gmail.com> #7
Hi. Is there any updates on this problem?
ek...@gmail.com <ek...@gmail.com> #8
Hi, I updated my version to alpha12 but still have these crashes. Please release a fix asap.
th...@elevo.io <th...@elevo.io> #9
Will there be fixes released this Wednesday?
[Deleted User] <[Deleted User]> #10
Hey, there is no release on Wednesday (holiday in the USA)
We haven't found the root cause of this exception, it happens when SQLite can't commit the transaction because some other connection has a lock, we need more information, a sample project that reproduces the issue preferably, or more details on how the database is being used (is it from multiple process? is there heavy concurrency?).
You can also increase the time SQLite will wait before it error with 'database locked' by executing PRAGMA busy_timeout = <time in ms>
, the current default is 3000
je...@gmail.com <je...@gmail.com> #11
Thank you for you response.
- Isn't these pull request addressed this issue?
1.1
https://android-review.googlesource.com/c/platform/frameworks/support/+/3408679 1.2https://android-review.googlesource.com/c/platform/frameworks/support/+/3114928 - According to RoomDB documentation about
withTransaction
: "Room will only perform at most one transaction at a time, additional transactions are queued and executed on a first come, first serve order." So the transaction should just wait for other transaction to complete and not throw exception instead. Isn't it?
[Deleted User] <[Deleted User]> #12
I tried to use this code and still getting the same error from users. (deferredTransaction
instead of immediateTransaction
)
private val dbMutex = Mutex()
suspend fun <R> MyDatabse.workaroundWithTransaction(block: suspend TransactionScope<R>.() -> R) {
dbMutex.withLock {
useWriterConnection {
it.deferredTransaction(block)
}
// TODO: Fix https://issuetracker.google.com/issues/340606803#comment2
// Manually triggers invalidation
invalidationTracker.refreshAsync()
}
}
Description
Older Google Sheets and other document types work fine.
Reproduction cases can be found in the following StackOverflow links:
The problem has been acknowledged as a bug on SO by a Google engineer on Nov 9 2014.