org.tmatesoft.sqljet.core.internal
Enum SqlJetSafetyLevel

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

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.


Enum Constant Summary
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).
NORMAL
          The journal is synced once before writes begin on the database.
OFF
          sqlite3OsSync() is never called.
 
Method Summary
static SqlJetSafetyLevel valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SqlJetSafetyLevel[] values()
          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, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

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 Detail

values

public static SqlJetSafetyLevel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SqlJetSafetyLevel c : SqlJetSafetyLevel.values())
    System.out.println(c);

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