configureCommon

Configures a RoomDatabase.Builder with standard settings for this project.

Parameters

multiConnection

when true (default), opens a multi-reader connection pool (maxNumOfReaders = 4, maxNumOfWriters = 1) so reads can run concurrently. Pass false to explicitly force setSingleConnectionPool, serializing all reads and writes through one connection.

Android production passes false. Without the explicit setSingleConnectionPool() call, Room defaults to a 4-reader pool for named databases regardless of whether setMultipleConnectionPool was called. Under coroutine cancellation churn (e.g. DB switches via flatMapLatest), the reader-pool permit semaphore can wedge: all reader connections report Free but permits=0, so every read acquisition times out indefinitely. Forcing single-connection eliminates the separate reader permit pool entirely.

In-memory databases (tests) pass false. Room already serves an in-memory database (name == null) from a single connection regardless of the pool configuration, so this only makes the single-connection intent explicit and serializes the query dispatcher; it is not load-bearing for read-after-write. (DeviceLinkRepositoryImplTest is deterministic because it runs on the wall clock, not because of this flag; see that test's comments.)

JVM/iOS production uses true (the default). Revisit if desktop/iOS field logs show similar pool-exhaustion patterns under cancellation churn.