|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.TransactionConfig
public class TransactionConfig
Specifies the attributes of a database environment transaction.
Field Summary | |
---|---|
static TransactionConfig |
DEFAULT
Default configuration used if null is passed to methods that create a transaction. |
Constructor Summary | |
---|---|
TransactionConfig()
An instance created using the default constructor is initialized with the system's default settings. |
Method Summary | |
---|---|
TransactionConfig |
clone()
Returns a copy of this configuration object. |
ReplicaConsistencyPolicy |
getConsistencyPolicy()
Returns the consistency policy associated with the configuration. |
Durability |
getDurability()
Returns the durability associated with the configuration. |
boolean |
getNoSync()
Deprecated. replaced by getDurability() |
boolean |
getNoWait()
Returns true if the transaction is configured to not wait if a lock request cannot be immediately granted. |
boolean |
getReadCommitted()
Returns true if the transaction is configured for read committed isolation. |
boolean |
getReadUncommitted()
Returns true if read operations performed by the transaction are configured to return modified but not yet committed data. |
boolean |
getSerializableIsolation()
Returns true if the transaction has been explicitly configured to have serializable (degree 3) isolation. |
boolean |
getSync()
Returns true if the transaction is configured to write and synchronously flush the log it when commits. |
boolean |
getWriteNoSync()
Deprecated. replaced by getDurability() |
TransactionConfig |
setConsistencyPolicy(ReplicaConsistencyPolicy consistencyPolicy)
Associates a consistency policy with this configuration. |
TransactionConfig |
setDurability(Durability durability)
Configures the durability associated with a transaction when it commits. |
TransactionConfig |
setNoSync(boolean noSync)
Deprecated. replaced by setDurability(com.sleepycat.je.Durability) |
TransactionConfig |
setNoWait(boolean noWait)
Configures the transaction to not wait if a lock request cannot be immediately granted. |
TransactionConfig |
setReadCommitted(boolean readCommitted)
Configures the transaction for read committed isolation. |
TransactionConfig |
setReadUncommitted(boolean readUncommitted)
Configures read operations performed by the transaction to return modified but not yet committed data. |
TransactionConfig |
setSerializableIsolation(boolean serializableIsolation)
Configures this transaction to have serializable (degree 3) isolation. |
TransactionConfig |
setSync(boolean sync)
Configures the transaction to write and synchronously flush the log it when commits. |
TransactionConfig |
setWriteNoSync(boolean writeNoSync)
Deprecated. replaced by setDurability(com.sleepycat.je.Durability) |
String |
toString()
Returns the values for each configuration attribute. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final TransactionConfig DEFAULT
Constructor Detail |
---|
public TransactionConfig()
Method Detail |
---|
public TransactionConfig setSync(boolean sync)
This behavior may be set for a database environment using the Environment.setMutableConfig method. Any value specified to this method overrides that setting.
The default is false for this class and true for the database environment.
If true is passed to both setSync and setNoSync, setSync will take precedence.
sync
- If true, transactions exhibit all the ACID (atomicity,
consistency, isolation, and durability) properties.
public boolean getSync()
public TransactionConfig setNoSync(boolean noSync)
setDurability(com.sleepycat.je.Durability)
This behavior may be set for a database environment using the Environment.setMutableConfig method. Any value specified to this method overrides that setting.
The default is false for this class and the database environment.
noSync
- If true, transactions exhibit the ACI (atomicity,
consistency, and isolation) properties, but not D (durability); that is,
database integrity will be maintained, but if the application or system
fails, it is possible some number of the most recently committed
transactions may be undone during recovery. The number of transactions
at risk is governed by how many log updates can fit into the log buffer,
how often the operating system flushes dirty buffers to disk, and how
often the log is checkpointed.
public boolean getNoSync()
getDurability()
public TransactionConfig setWriteNoSync(boolean writeNoSync)
setDurability(com.sleepycat.je.Durability)
This behavior may be set for a database environment using the Environment.setMutableConfig method. Any value specified to this method overrides that setting.
The default is false for this class and the database environment.
writeNoSync
- If true, transactions exhibit the ACI (atomicity,
consistency, and isolation) properties, but not D (durability); that is,
database integrity will be maintained, but if the operating system
fails, it is possible some number of the most recently committed
transactions may be undone during recovery. The number of transactions
at risk is governed by how often the operating system flushes dirty
buffers to disk, and how often the log is checkpointed.
public boolean getWriteNoSync()
getDurability()
public TransactionConfig setDurability(Durability durability)
durability
- the durability definition
public Durability getDurability()
public TransactionConfig setConsistencyPolicy(ReplicaConsistencyPolicy consistencyPolicy)
consistencyPolicy
- the consistency definition
public ReplicaConsistencyPolicy getConsistencyPolicy()
public TransactionConfig setNoWait(boolean noWait)
The default is false for this class and the database environment.
noWait
- If true, transactions will not wait if a lock request
cannot be immediately granted, instead LockNotAvailableException
will be thrown.
public boolean getNoWait()
public TransactionConfig setReadUncommitted(boolean readUncommitted)
readUncommitted
- If true, configure read operations performed by
the transaction to return modified but not yet committed data.
LockMode.READ_UNCOMMITTED
public boolean getReadUncommitted()
LockMode.READ_UNCOMMITTED
public TransactionConfig setReadCommitted(boolean readCommitted)
This ensures the stability of the current data item read by the cursor but permits data read by this transaction to be modified or deleted prior to the commit of the transaction.
readCommitted
- If true, configure the transaction for read
committed isolation.
LockMode.READ_COMMITTED
public boolean getReadCommitted()
LockMode.READ_COMMITTED
public TransactionConfig setSerializableIsolation(boolean serializableIsolation)
By default a transaction provides Repeatable Read isolation; EnvironmentConfig.setTxnSerializableIsolation(boolean)
may be called to override
the default. If the environment is configured for serializable
isolation, all transactions will be serializable regardless of whether
this method is called; calling setSerializableIsolation(boolean)
with a
false parameter will not disable serializable isolation.
LockMode
public boolean getSerializableIsolation()
LockMode
public TransactionConfig clone()
clone
in class Object
public String toString()
toString
in class Object
|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |