.1. Richiede un blocco sulla voce esistente in modo che i tentativi successivi di inserire un record duplicato falliscano in modo coerente:
-- Transaction A
BEGIN TRANSACTION;
INSERT INTO mytable VALUE(1); -- fails as "duplicate"
-- Transaction B
BEGIN;
DELETE FROM mytable WHERE field = 1; -- must be put on hold, see below
-- Transaction A
-- transaction is still in progress
INSERT INTO mytable VALUE(1); -- must fail to stay consistent with the previous attempt
.2. Sì e sì :