public interface TxnConfig
Txn
. In the beginning this was all
placed in the Txn, adding a lot of 'informational' methods to the transaction and therefor
complicating its usage. So all the configurational properties of the transaction are contained in
this structure.
The same TxnConfig is used for multiple transactions. Each TxnFactory has just a
single configuration and all Transactions created by that TxnFactory, share that configuration.Modifier and Type | Method and Description |
---|---|
BackoffPolicy |
getBackoffPolicy()
Returns the BackoffPolicy used by the Stm when a transaction conflicts with another transaction.
|
String |
getFamilyName()
Returns the family name of this Txn.
|
IsolationLevel |
getIsolationLevel()
Gets the IsolationLevel used.
|
int |
getMaxRetries()
Returns the maximum number of times this Txn be retried before failing.
|
List<TxnListener> |
getPermanentListeners()
Returns an unmodifiable list containing all permanent TxnListener.
|
PropagationLevel |
getPropagationLevel()
Returns the PropagationLevel used.
|
LockMode |
getReadLockMode()
Gets the current LockMode for all reads.
|
int |
getSpinCount()
Returns the maximum number of times the transaction is allowed to spin on a read to become
readable (perhaps it is locked).
|
Stm |
getStm()
Returns the Stm that creates transactions based on this configuration.
|
long |
getTimeoutNs()
Returns the total timeout in nanoseconds.
|
TraceLevel |
getTraceLevel()
Returns the TraceLevel.
|
LockMode |
getWriteLockMode()
Gets the current LockMode for all writes.
|
boolean |
isBlockingAllowed()
If an explicit retry (so a blocking transaction) is allowed.
|
boolean |
isControlFlowErrorsReused()
Checks if the
ControlFlowError is cached or a new one is used. |
boolean |
isDirtyCheckEnabled()
Checks if dirty check is enabled on writes when a transaction commits.
|
boolean |
isInterruptible()
Checks if the Txn can be interrupted if it is blocking.
|
boolean |
isReadonly()
Checks if this Txn is readonly.
|
boolean |
isReadTrackingEnabled()
Checks if this transaction does automatic read tracking.
|
boolean |
isSpeculative()
Checks if speculative configuration is enabled.
|
Stm getStm()
boolean isControlFlowErrorsReused()
ControlFlowError
is cached or a new one is used.
Exception creation can be very expensive, so by default the ControlFlowError is reused, but this can
be problematic when debugging.TxnFactoryBuilder.setControlFlowErrorsReused(boolean)
IsolationLevel getIsolationLevel()
TxnFactoryBuilder.setIsolationLevel(IsolationLevel)
long getTimeoutNs()
TxnFactoryBuilder.setTimeoutNs(long)
PropagationLevel getPropagationLevel()
TxnFactoryBuilder.setPropagationLevel(PropagationLevel)
TraceLevel getTraceLevel()
TxnFactoryBuilder.setTraceLevel(TraceLevel)
BackoffPolicy getBackoffPolicy()
TxnFactoryBuilder.setBackoffPolicy(BackoffPolicy)
boolean isSpeculative()
SpeculativeConfigurationError
. This will be caught by the
TxnExecutor and the transaction will be retried, so in most cases this is not something to worry
about, but it can be confusing in the beginning because of unexpected failures in the execution
of transactions.TxnFactoryBuilder.setSpeculative(boolean)
String getFamilyName()
TxnFactoryBuilder.setFamilyName(String)
boolean isReadonly()
TxnFactoryBuilder.setReadonly(boolean)
int getSpinCount()
TxnFactoryBuilder.setSpinCount(int)
LockMode getReadLockMode()
TxnFactoryBuilder.setReadLockMode(LockMode)
LockMode getWriteLockMode()
TxnFactoryBuilder.setWriteLockMode(LockMode)
boolean isDirtyCheckEnabled()
TxnFactoryBuilder.setDirtyCheckEnabled(boolean)
boolean isReadTrackingEnabled()
TxnFactoryBuilder.setReadTrackingEnabled(boolean)
boolean isBlockingAllowed()
TxnFactoryBuilder.setBlockingAllowed(boolean)
boolean isInterruptible()
TxnFactoryBuilder.setInterruptible(boolean)
List<TxnListener> getPermanentListeners()
TxnFactoryBuilder.addPermanentListener(org.multiverse.api.lifecycle.TxnListener)
int getMaxRetries()
TxnFactoryBuilder.setMaxRetries(int)
Copyright © 2020. All rights reserved.