Room 3.0 went stable on July 1, 2026, and the androidx.room3 3.1 alpha line has been quietly adding the knobs people asked for since. The latest, 3.1.0-alpha04 (Nov 18, 2026), is the fourth alpha; the stable line is currently 3.0.3. This post walks through what 3.1 adds so far, with the API names taken from the official release notes, and what I would and would not try in a production app today.
1. Property-centric entities (alpha01)
The annotations @ColumnInfo, @PrimaryKey, @Relation, @Embedded, @Ignore and @ColumnTypeConverters now accept AnnotationTarget.PROPERTY. Room becomes property-centric rather than field-centric, so a property without a backing field can represent a column or a query result column. It still needs a usable getter and either a usable setter or a place in the primary constructor.
2. Connection and statement tuning
- alpha01:
setConnectionPoolTimeout(timeout: Duration)onRoomDatabase.Builder. - alpha03:
setPreparedStatementCacheSize(maxCacheSize: Int)on Android, to configure or disable the per-connection prepared statement cache. - alpha03:
allowDataLossOnRecovery(), to let Room recover from database opening and corruption failures.
import androidx.room3.Room
import kotlin.time.Duration.Companion.seconds
val db = Room.databaseBuilder<MusicDatabase>(context, "music.db")
.setDriver(AndroidSQLiteDriver())
.setConnectionPoolTimeout(10.seconds)
.setPreparedStatementCacheSize(32)
.allowDataLossOnRecovery()
.build()
Note the name: allowDataLossOnRecovery() is an explicit opt-in. For a cache database it is a sensible safety net; for a database holding user-authored data, I would rather surface the failure and restore from backup than silently start empty. The cache size value above is an arbitrary example, not a recommendation from the release notes.
3. Built-in Uuid support (alpha01)
Room now has a built-in column type converter for kotlin.uuid.Uuid, and the generated _Impl classes suppress OPT_IN_USAGE_ERROR and OPT_IN_USAGE. That means DAOs and entities can use @RequiresOptIn types like Uuid without adding -opt-in to freeCompilerArgs.
4. DAO return type converters get finer-grained (alpha04)
In Room 3.0, custom return types such as PagingSource are produced by @DaoReturnTypeConverter functions registered through @DaoReturnTypeConverters. Alpha04 makes the registration more flexible:
@DaoReturnTypeConvertersis now supported on individual DAO functions and on@Querygetter properties, not only on a@Databaseor@Dao.- A
@Dao-scoped registration now takes priority over a@Database-scoped one. - Read converters can take an optional
Map<String, Any?>parameter to access the DAO query arguments.
@Dao
interface MusicDao {
@Query("SELECT * FROM Song")
@DaoReturnTypeConverters(PagingSourceDaoReturnTypeConverter::class)
fun pagedSongs(): PagingSource<Int, Song>
@Query("SELECT * FROM Song WHERE artistId = :artistId")
suspend fun songsBy(artistId: Long): List<Song>
}
The practical win is blast radius: you can scope an exotic converter to the one function that needs it instead of registering it for a whole database. Placing the annotation on a function is what alpha04 documents; the exact placement in my snippet follows that description and I have not compiled it against the alpha.
5. Fixes worth knowing about
- Collection query parameters with a custom
@ColumnTypeConverterwere being expanded into multiple parameters instead of converted as a single value insideCOALESCEexpressions (alpha04). - KSP silently ignored non-constant annotation arguments such as
@ColumnInfo.defaultValue, which exported incomplete schemas and caused misleading auto-migration errors (alpha04). If an auto-migration failed oddly on an earlier build, this is a candidate cause. - Kotlin value classes with
@MapColumnin multimap queries could emit falseequals()/hashCode()warnings or fail to map the column (alpha04). - DAO queries with
@Relationand non-deterministic clauses such asORDER BY RANDOM() LIMIT :countre-executed on statement reset and broke relationship mapping (alpha03). - Cancelling a coroutine during a transaction on web and suspending drivers could leave the database and connection in a bad state (alpha01, also backported to 3.0.3).
- Kotlin
objectimplementations ofAutoMigrationSpecare supported (alpha01). - The
watchosArm32target was removed because Kotlin 2.5 no longer supports it (alpha04).
6. What I would do
If you are on Room 2.x, the move to androidx.room3 is still the big decision, and 3.0.3 is the version to evaluate. Stay off the 3.1 alphas in production, but try them in a branch if you hit one of the fixed issues above, mainly the KSP default-value schema bug or the transaction cancellation behavior. Remember 3.1 libraries target Kotlin 2.2 and require kotlinc 2.2.
Takeaway: Room 3.1 is about control and correctness: finer-scoped DAO converters, tunable connection and statement caches, an explicit recovery opt-in, and a set of KSP and transaction fixes. Evaluate on 3.0.3, track the alphas for the fixes you need.
Sources: AndroidX Room 3.0 release notes on developer.android.com (3.0.0 through 3.1.0-alpha04), and the AndroidX library release index, both fetched Nov 22, 2026. Code samples are my own illustrations of the documented APIs and were not compiled against the alpha.
No comments yet. Be the first to leave one!