A real DatabaseProvider that uses an in-memory database for testing.
Optional barrier/fault hook used to prove overlapping repository writes before they enter Room.
Simulates the active-DB switch that happens when the app selects a different device — the new DB has no rows, so any cache that lived only in the previous DB is gone. Closes the prior DB to free its resources.