シリアライザブル隔離レベル

29) Serializable provides the highest transaction isolation. When a transaction is on the serializable level, a query sees only data committed before the transaction began and never see either dirty data or concurrent transaction changes committed during transaction execution. So, this level emulates serial transaction execution, as if transactions would be executed one after another, serially, rather than concurrently.

シリアライザブル レベルは,トランザクションの隔離と しては最も厳密なものです.トランザクションがこのレベルにある場合, 問い合わせが注目するのは,このトランザクションが開始される直前までに コミットされたデータのみであり,ダーティ・データも,トランザクションを 実行と同時に実行されている(別の)トランザクションがコミットした変更の 関与も一切ありません. つまり,このレベルが作り出そうとしているのは逐次的なトランザクションの 実行 − トランザクションが同時にではなく,あたかもひとつずつ順番に 実行されるように振舞うことです.

30) If a row returned by query while executing a UPDATE (or DELETE or SELECT FOR UPDATE) statement is being updated by a concurrent uncommitted transaction then the second transaction that tries to update this row will wait for the other transaction to commit or rollback. In the case of rollback, the waiting transaction can proceed to change the row. In the case of a concurrent transaction commit, a serializable transaction will be rolled back with the message

ふたたび UPDATE (または DELETESELECT FOR UPDATE )文を実行中に返された行を, 同時に実行されている,コミットされていないトランザクションが更新しようと しているとします.そのトランザクションは元のトランザクションが コミット,またはロールバックされるまで待ち状態に入ります. ロールバックがあった場合,待ち状態にあるトランザクションは行を 更新します.一方,コミットされた場合,シリアライザブルレベルに 設定されているトランザクションは以下のメッセージを出してロールバック します.

ERROR:  Can't serialize access due to concurrent update
(エラー:同時に実行されているトランザクションが更新をおこなったため,逐次アクセスができませんでした)
    
31) because a serializable transaction cannot modify rows changed by other transactions after the serializable transaction began. シリアライザブルレベルに設定されたトランザクションは,その トランザクションの開始以降に他のトランザクションが変更した行を 更新できないのです.

Note: 32) Note that results of execution of SELECT or INSERT (with a query) will not be affected by concurrent transactions.

SELECT ,(問い合わせつき) INSERT 文は,同時に実行されるトランザクションの影響を 受けません.