Skip to content

feat: enable WAL connection pool for parallel reads#5372

Open
jamesarich wants to merge 1 commit intomainfrom
feat/wal-connection-pool
Open

feat: enable WAL connection pool for parallel reads#5372
jamesarich wants to merge 1 commit intomainfrom
feat/wal-connection-pool

Conversation

@jamesarich
Copy link
Copy Markdown
Collaborator

Enables Room's setMultipleConnectionPool() (new in Room 3.0.0-alpha04) for WAL-mode databases.

Changes

  • Configure 4 reader connections + 1 writer connection in configureCommon()
  • Allows parallel read queries while writes are in progress

Impact

  • Improved read performance under concurrent access (message list + search + sync)
  • No schema change required
  • WAL mode was already enabled by default in Room

Room 3.0.0-alpha04 adds setMultipleConnectionPool(). Enable it with
4 readers / 1 writer to allow concurrent read operations (paging,
multiple Flow collectors) without contention.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the enhancement New feature or request label May 6, 2026
@jamesarich jamesarich requested a review from Copilot May 6, 2026 20:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables Room 3’s multi-connection pool on the shared RoomDatabase.Builder configuration to allow parallel reads while writes are in progress (WAL-mode), improving responsiveness under concurrent database access (e.g., message list + search + sync).

Changes:

  • Enable setMultipleConnectionPool(maxNumOfReaders = 4, maxNumOfWriters = 1) in the project’s common Room builder configuration.
  • Keep existing destructive-migration fallback and query coroutine context configuration intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants