public class STransactionConfig
extends java.lang.Object
For a user created instance, no attribute is set by default. In addition, calling the getter method of an unset attribute results in an IllegalStateException. To set an attribute, call the setter method of the attribute.
When used to begin a new transaction, system default values are used for unset attributes.
Constructor and Description |
---|
STransactionConfig()
Create an empty STransactionConfig with no attribute set.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getBulk()
Return true if the Bulk attribute is set.
|
protected java.lang.Object |
getField(F field)
Return the value set on a specified field.
|
boolean |
getNoSync()
Return if the transaction is configured to not write or synchronously
flush the log when it commits.
|
boolean |
getNoWait()
Return if the transaction is configured to not wait if a lock request
cannot be immediately granted.
|
boolean |
getReadCommitted()
Return if the transaction is configured for read committed isolation.
|
boolean |
getReadUncommitted()
Return if read operations performed by the transaction are configured to
return modified but not yet committed data.
|
boolean |
getSnapshot()
Return true if the transaction is configured for Snapshot Isolation.
|
boolean |
getSync()
Return if the transaction is configured to write and synchronously
flush the log when it commits.
|
protected T |
getThriftObj() |
boolean |
getWait()
Return if the transaction is configured to wait if a lock request cannot
be immediately granted.
|
boolean |
getWriteNoSync()
Return if the transaction is configured to write but not synchronously
flush the log when it commits.
|
STransactionConfig |
setBulk(boolean bulk)
Configures the transaction to enable the transactional bulk insert
optimization.
|
STransactionConfig |
setNoSync(boolean noSync)
Configure the transaction to not write or synchronously flush the log
when it commits.
|
STransactionConfig |
setNoWait(boolean noWait)
Configure the transaction to not wait if a lock request cannot be
immediately granted.
|
STransactionConfig |
setReadCommitted(boolean readCommitted)
Configure the transaction for read committed isolation.
|
STransactionConfig |
setReadUncommitted(boolean readUncommitted)
Configure read operations performed by the transaction to return
modified
but not yet committed data.
|
STransactionConfig |
setSnapshot(boolean snapshot)
This transaction will execute with snapshot isolation.
|
STransactionConfig |
setSync(boolean sync)
Configure the transaction to write and synchronously flush the log
when it commits.
|
STransactionConfig |
setWait(boolean wait)
Configure the transaction to wait if a lock request cannot be
immediately granted.
|
STransactionConfig |
setWriteNoSync(boolean writeNoSync)
Configure the transaction to write but not synchronously flush the log
when it commits.
|
public STransactionConfig()
public boolean getBulk()
public STransactionConfig setBulk(boolean bulk)
The bulk insert optimization is effective only for top-level transactions.
bulk
- if true, configure the transaction to enable the bulk
optimization.public boolean getNoSync()
public STransactionConfig setNoSync(boolean noSync)
This behavior may be set for a database environment using the SEnvironment.setConfig(SEnvironmentConfig)
method. Any value specified
to this method overrides that setting.
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 server 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
server operating system flushes dirty buffers to disk, and how often the
log is checkpointed.public boolean getSync()
public STransactionConfig setSync(boolean sync)
sync
- if true, transactions exhibit all the ACID (atomicity,
consistency, isolation, and durability) properties.public boolean getWriteNoSync()
public STransactionConfig setWriteNoSync(boolean writeNoSync)
This behavior may be set for a database environment using the SEnvironment.setConfig(SEnvironmentConfig)
method. Any value specified
to this method overrides that setting.
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 server 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
server operating system flushes dirty buffers to disk, and how often the
log is checkpointed.public boolean getNoWait()
public STransactionConfig setNoWait(boolean noWait)
noWait
- if true, transactions will not wait if a lock request
cannot be immediately granted, instead SDeadlockException
will be thrown.public boolean getWait()
public STransactionConfig setWait(boolean wait)
wait
- if true, transactions will wait if a lock request cannot be
immediately granted.public boolean getReadCommitted()
public STransactionConfig 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.public boolean getReadUncommitted()
public STransactionConfig setReadUncommitted(boolean readUncommitted)
readUncommitted
- if true, configure read operations performed by
the transaction to return modified but not yet committed data.public boolean getSnapshot()
public STransactionConfig setSnapshot(boolean snapshot)
SDatabaseConfig.setMultiversion(boolean)
, data values
will be read as they are when the transaction begins, without taking
read locks.
Updates operations performed in the transaction will cause a
SDeadlockException
to be thrown if data is modified between
reading and writing it.
snapshot
- if this transaction will execute with snapshot isolationprotected T getThriftObj()
protected java.lang.Object getField(F field) throws java.lang.IllegalStateException
field
- the fieldjava.lang.IllegalStateException
- if the field is not setCopyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.