Transactional Isolation And Propagation
Propagation
Defines how transactions relate to each other. Common options:
Required
: Code will always run in a transaction. Creates a new transaction or reuses one if available.Requires_new
: Code will always run in a new transaction. Suspends the current transaction if one exists.
Isolation
Defines the data contract between transactions.
Read Uncommitted
: Allows dirty reads.Read Committed
: Does not allow dirty reads.Repeatable Read
: If a row is read twice in the same transaction, the result will always be the same.Serializable
: Performs all transactions in a sequence.
The different levels have different performance characteristics in a multi-threaded
application. Those who understand the dirty reads
concept they are able to be select a good option.