Enum Class DurabilityMode
- All Implemented Interfaces:
Serializable
,Comparable<DurabilityMode>
,Constable
Various transaction durability modes, which control the durability
strength of committed transactions. Strong modes offer safety, but they are also relatively
slow. Weak modes are faster, but transactions committed in one of these modes can get lost.
Modes ordered from strongest to weakest:
Note: When replication is enabled, the NO_SYNC
mode is no stronger than the
NO_FLUSH
mode.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDurability mode which writes modifications to the file system when the in-process buffer is full, or by automatic checkpoints.Weakest durability mode, which doesn't write anything to the redo log or replication manager.Durability mode which permits the operating system to lazily persist modifications to non-volatile storage.Strongest durability mode, which ensures all modifications are unlikely to be lost in the event of a sudden power failure or crash. -
Method Summary
Modifier and TypeMethodDescriptionstatic DurabilityMode
Returns the enum constant of this class with the specified name.static DurabilityMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SYNC
Strongest durability mode, which ensures all modifications are unlikely to be lost in the event of a sudden power failure or crash. Typically, this requires that all data be persisted to non-volatile storage. If the database is replicated, it might only guarantee that enough replicas have committed modifications to volatile memory, and so thesync
method would also need to be called to achieve stronger durability. -
NO_SYNC
Durability mode which permits the operating system to lazily persist modifications to non-volatile storage. This mode is vulnerable to power failures, operating system crashes, and replication failures. Any of these events can cause recently committed transactions to get lost. -
NO_FLUSH
Durability mode which writes modifications to the file system when the in-process buffer is full, or by automatic checkpoints. In addition to the vulnerabilities of NO_SYNC mode, NO_FLUSH mode can lose recently committed transactions when the process crashes. When the process exits cleanly, a shutdown hook switches this mode to behave like NO_SYNC and flushes the log. -
NO_REDO
Weakest durability mode, which doesn't write anything to the redo log or replication manager. An unlogged transaction does not become durable until a checkpoint is performed. In addition to the vulnerabilities of NO_FLUSH mode, NO_REDO mode can lose recently committed transactions when the process exits.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-