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>
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)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 namejava.lang.NullPointerException
- if the argument is null
-
-