Status Update
Comments
ea...@google.com <ea...@google.com> #3
As I understand, Room serializes all transactions from all connections onto a single thread eagerly. If that's correct, how will this be implemented in Room so we can actually take advantage of multi-thread transactional readers?
From:
... Room will not use more than one thread at a time from this executor since only one transaction at a time can be executed, other transactions will be queued on a first come, first serve order. ...
From:
Room will only perform at most one transaction at a time, additional transactions are queued and executed on a first come, first serve order.
It seems beginTransactionDeferred is a bit at odds with the current Transaction structure of Room?
da...@google.com <da...@google.com> #4
Similar to how the framework had to make deferred transactions to use secondary connections (@ReadOnlyTransaction
or similar API along side a coroutine equivalent withReadOnlyTransaction
.
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit 2ad50e94e4806509ee3d710491a60a1153b43a1f
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Nov 06 19:33:13 2023
Add beginTransactionReadOnly() to SupportSQLiteDatabase
Bug: 288918056
Test: FrameworkSQLiteDatabaseTest
Relnote: "Add beginTransactionReadOnly() to perform DEFERRED transactions."
Change-Id: I0c54c075ec4ad8c6abddaefc10374f857d1cd848
M sqlite/sqlite-framework/src/androidTest/java/androidx/sqlite/db/framework/FrameworkSQLiteDatabaseTest.kt
M sqlite/sqlite-framework/src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteDatabase.kt
M sqlite/sqlite/api/current.txt
M sqlite/sqlite/api/restricted_current.txt
M sqlite/sqlite/src/main/java/androidx/sqlite/db/SupportSQLiteDatabase.kt
Description
See ag/22164371