The RollbackCause for an atomic block that should not be restarted
because it threw an exception. The exception might have been thrown from
the body of the atomic block or from a handler invoked before the commit
decision. Exceptions used for control flow are not included (see
TxnExecutor.isControlFlow).
Scala's STM discards Ref writes performed by atomic blocks that throw
an exception. This is referred to as "failure atomicity". In a system
that uses exceptions for error cleanup this design tends to preserve the
invariants of shared data structures, which is a good thing. If a system
uses exceptions for control flow, however, this design may lead to
unexpected behavior. The TxnExecutor object's isControlFlow method
is used to distinguish exceptions representing control flow transfers
from those used to represent error conditions. See
TxnExecutor.transformDefault to change the default rules.
The
RollbackCause
for an atomic block that should not be restarted because it threw an exception. The exception might have been thrown from the body of the atomic block or from a handler invoked before the commit decision. Exceptions used for control flow are not included (seeTxnExecutor.isControlFlow
).Scala's STM discards
Ref
writes performed by atomic blocks that throw an exception. This is referred to as "failure atomicity". In a system that uses exceptions for error cleanup this design tends to preserve the invariants of shared data structures, which is a good thing. If a system uses exceptions for control flow, however, this design may lead to unexpected behavior. TheTxnExecutor
object'sisControlFlow
method is used to distinguish exceptions representing control flow transfers from those used to represent error conditions. SeeTxnExecutor.transformDefault
to change the default rules.