Enum SqlJetSafetyLevel

java.lang.Object
java.lang.Enum<SqlJetSafetyLevel>
org.tmatesoft.sqljet.core.internal.SqlJetSafetyLevel
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SqlJetSafetyLevel>, java.lang.constant.Constable

public enum SqlJetSafetyLevel extends java.lang.Enum<SqlJetSafetyLevel>
Valuest to adjust the robustness of the database to damage due to OS crashes or power failures by changing the number of syncs()s when writing the rollback journal.
Author:
TMate Software Ltd., Sergey Scherbina (sergey.scherbina@gmail.com)
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The journal is synced twice before writes begin on the database (with some additional information - the nRec field of the journal header - being written in between the two syncs).
    The journal is synced once before writes begin on the database.
    sqlite3OsSync() is never called.
  • Method Summary

    Modifier and Type
    Method
    Description
    valueOf(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • OFF

      public static final SqlJetSafetyLevel OFF
      sqlite3OsSync() is never called. This is the default for temporary and transient files.
    • NORMAL

      public static final SqlJetSafetyLevel NORMAL
      The journal is synced once before writes begin on the database. This is normally adequate protection, but it is theoretically possible, though very unlikely, that an inopertune power failure could leave the journal in a state which would cause damage to the database when it is rolled back.
    • FULL

      public static final SqlJetSafetyLevel FULL
      The journal is synced twice before writes begin on the database (with some additional information - the nRec field of the journal header - being written in between the two syncs). If we assume that writing a single disk sector is atomic, then this mode provides assurance that the journal will not be corrupted to the point of causing damage to the database during rollback.
  • Method Details

    • values

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

      public static SqlJetSafetyLevel valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null