Enum Class JournalMode

java.lang.Object
java.lang.Enum<JournalMode>
dev.rafex.ether.database.sqlite.config.JournalMode
All Implemented Interfaces:
Serializable, Comparable<JournalMode>, Constable

public enum JournalMode extends Enum<JournalMode>
SQLite journal modes.

Corresponds to the PRAGMA journal_mode setting.

See Also:
  • Enum Constant Details

    • WAL

      public static final JournalMode WAL
      Write-Ahead Logging mode.

      Allows concurrent reads and writes, with better performance for write-intensive workloads. The default and recommended mode for most applications.

    • DELETE

      public static final JournalMode DELETE
      Rollback journal mode (default in SQLite < 3.7.0).

      Creates a separate rollback journal file (-journal) that is deleted after each transaction.

    • TRUNCATE

      public static final JournalMode TRUNCATE
      Truncate journal mode.

      Similar to DELETE but truncates the journal file to zero bytes instead of deleting it, which can be faster on some filesystems.

    • PERSIST

      public static final JournalMode PERSIST
      Persistent journal mode.

      The journal file is never deleted, only overwritten. Can be slightly faster than DELETE on filesystems where file creation is expensive.

    • MEMORY

      public static final JournalMode MEMORY
      Memory journal mode.

      The journal is kept in memory, not on disk. Transactions are atomic but not durable across application crashes.

    • OFF

      public static final JournalMode OFF
      No journal mode.

      No rollback journal is maintained. Transactions may be rolled back on application crash, leaving the database in an inconsistent state. Not recommended for production use.

  • Method Details

    • values

      public static JournalMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JournalMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null