Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

JournalMode

class JournalMode
kotlin.Any
   ↳ kotlin.Enum<androidx.room.RoomDatabase.JournalMode>
   ↳ androidx.room.RoomDatabase.JournalMode

Journal modes for SQLite database.

Summary

Enum values

Let Room choose the journal mode.

Truncate journal mode.

Write-Ahead Logging mode.

Enum values

AUTOMATIC

enum val AUTOMATIC : RoomDatabase.JournalMode

Let Room choose the journal mode. This is the default value when no explicit value is specified.

The actual value will be TRUNCATE when the device runs API Level lower than 16 or it is a low-RAM device. Otherwise, WRITE_AHEAD_LOGGING will be used.

TRUNCATE

enum val TRUNCATE : RoomDatabase.JournalMode

Truncate journal mode.

WRITE_AHEAD_LOGGING

enum val WRITE_AHEAD_LOGGING : RoomDatabase.JournalMode

Write-Ahead Logging mode.