I am using Room Persistence Library 1.1.0. I could find the database file at /data/data/
using Android Studio\'s De
You can use the wal_checkpoint
pragma to trigger a checkpoint which will move the WAL file transactions back into the database.
theRoomDb.query("pragma wal_checkpoint(full)", null)
or
// the result
// contains 1 row with 3 columns
// busy, log, checkpointed
Cursor cursor = theRoomDb.query("pragma wal_checkpoint(full)", null)
See PRAGMA Statements for more details about the pragma parameter values and results.
If the WAL is not enabled the pragma does nothing. By the way, I tested with Room 1.1.1, and the WAL mode was not used by default, I had to enable it.