java.lang.Cloneable
public class TransactionConfig
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field | Description |
---|---|---|
static TransactionConfig |
DEFAULT |
Default configuration used if null is passed to methods that create a
transaction.
|
Constructor | Description |
---|---|
TransactionConfig() |
An instance created using the default constructor is initialized
with the system's default settings.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
getBulk() |
Return true if the Bulk attribute is set.
|
boolean |
getDegree2() |
Deprecated.
This has been replaced by
getReadCommitted() to conform to ANSI
database isolation terminology. |
boolean |
getDirtyRead() |
Deprecated.
This has been replaced by
getReadUncommitted() to conform to ANSI
database isolation terminology. |
boolean |
getNoSync() |
Return if the transaction is configured to not write or synchronously
flush the log it when 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 it when commits.
|
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 it when commits.
|
void |
setBulk(boolean bulk) |
Configures the transaction to enable the transactional bulk insert
optimization.
|
void |
setDegree2(boolean degree2) |
Deprecated.
This has been replaced by
setReadCommitted(boolean) to conform to ANSI
database isolation terminology. |
void |
setDirtyRead(boolean dirtyRead) |
Deprecated.
This has been replaced by
setReadUncommitted(boolean) to conform to ANSI
database isolation terminology. |
void |
setNoSync(boolean noSync) |
Configure the transaction to not write or synchronously flush the log
it when commits.
|
void |
setNoWait(boolean noWait) |
Configure the transaction to not wait if a lock request cannot be
immediately granted.
|
void |
setReadCommitted(boolean readCommitted) |
Configure the transaction for read committed isolation.
|
void |
setReadUncommitted(boolean readUncommitted) |
Configure read operations performed by the transaction to return modified
but not yet committed data.
|
void |
setSnapshot(boolean snapshot) |
This transaction will execute with snapshot isolation.
|
void |
setSync(boolean sync) |
Configure the transaction to write and synchronously flush the log
it when commits.
|
void |
setWait(boolean wait) |
Configure the transaction to wait if a lock request cannot be
immediately granted.
|
void |
setWriteNoSync(boolean writeNoSync) |
Configure the transaction to write but not synchronously flush the log
it when commits.
|
public static final TransactionConfig DEFAULT
public TransactionConfig()
public void 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 getReadCommitted()
@Deprecated public void setDegree2(boolean degree2)
setReadCommitted(boolean)
to conform to ANSI
database isolation terminology.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.
degree2
- If true, configure the transaction for read committed isolation.
@Deprecated public boolean getDegree2()
getReadCommitted()
to conform to ANSI
database isolation terminology.public void setReadUncommitted(boolean readUncommitted)
readUncommitted
- If true, configure read operations performed by the transaction to return
modified but not yet committed data.public boolean getReadUncommitted()
@Deprecated public void setDirtyRead(boolean dirtyRead)
setReadUncommitted(boolean)
to conform to ANSI
database isolation terminology.dirtyRead
- If true, configure read operations performed by the transaction to return
modified but not yet committed data.
@Deprecated public boolean getDirtyRead()
getReadUncommitted()
to conform to ANSI
database isolation terminology.public void setNoSync(boolean noSync)
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()
public void 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 DeadlockException
will be thrown.public boolean getNoWait()
public void setSnapshot(boolean snapshot)
DatabaseConfig.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
DeadlockException
to be thrown if data is modified
between reading and writing it.
snapshot
- if this transaction will execute with snapshot isolationpublic boolean getSnapshot()
This method may be called at any time during the life of the application.
public void 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 void setWait(boolean wait)
The default is true unless EnvironmentConfig.setTxnNoWait(boolean)
is called.
wait
- If true, transactions will wait if a lock request cannot be
immediately granted, instead DeadlockException
will be thrown.public boolean getWait()
public void setWriteNoSync(boolean writeNoSync)
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()
public void setBulk(boolean bulk)
EnvironmentConfig
for further information.
The bulk insert optimization is effective only for top-level transactions.
bulk
- If true, configure the transaction to enable the bulk optimization.public boolean getBulk()
Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.