A robot job-import helper can catch a database constraint error and still have new rows waiting inside its open transaction. The exception identifies a failed statement outcome; it does not, by itself, establish that every row attempted by that statement was undone. In SQLite, the selected conflict algorithm changes that boundary.

An original in-memory replay compares INSERT OR ABORT with INSERT OR FAIL. It uses invented job references and explicit transaction control, with no production database, controller connection, or robot action. The test asks a narrow question: which records remain visible on the same connection immediately after the error, and which remain after an explicit rollback?

Fix the table and starting state

The fictional jobs table has an integer primary key named id and a required unique text field named ref. Before the tested transaction begins, the fixture inserts and commits row 1 with reference base. That row provides an existing value against which a later UNIQUE conflict can occur.

The fixture then starts an explicit transaction and inserts row 90 with reference earlier as a separate successful statement. This record matters because it distinguishes work performed before the failing statement from work performed within that statement. Both comparison cases start from these same logical conditions in separate private databases.

Submit one statement with three proposed rows

The tested statement proposes row 2 with reference new, row 3 with reference base, and row 4 with reference later. The second proposed reference collides with the already committed base reference. The first and third proposed references do not collide with any other value in this small fixture.

Each case uses one SQL statement containing three VALUES entries. It is not an executemany loop or a sequence of three individually issued INSERT statements. Replacing the single statement with several calls would change the boundary being examined and would require its own receipt.

Read the documented conflict boundary

SQLite's ON CONFLICT reference describes ABORT as backing out changes made by the failing statement while preserving earlier statements in the current transaction. It describes FAIL as stopping on an applicable constraint violation while retaining prior changes from that statement and leaving the transaction open.

The replay uses a UNIQUE violation, which is within that comparison's documented scope. It does not generalize FAIL behavior to foreign-key errors. It also keeps triggers and additional conflict mechanisms out of the schema, so the difference can be attributed to the selected statement-level algorithm under these inputs.

Inspect the ABORT case

With INSERT OR ABORT, the installed runtime raises an IntegrityError identifying a UNIQUE constraint violation. A SELECT on the same connection returns only row 1/base and row 90/earlier. Row 2/new, although it appeared before the conflicting entry in the submitted VALUES list, is not retained after this statement fails.

The connection still reports an active transaction. Row 90 remains because its successful insertion was a separate earlier statement inside that transaction. Calling the error a transaction rollback would therefore misdescribe the observed state. The prior committed baseline and the current transaction's earlier work are both still visible.

Inspect the FAIL case

With INSERT OR FAIL, the runtime raises the same exception class and the same extended UNIQUE-constraint error name. This time the same-connection query returns row 1/base, row 2/new, and row 90/earlier. Row 3 is absent, and row 4/later is absent.

That result shows why an exception-only receipt is incomplete. Both calls failed with a constraint error, but one retained a row from the failed statement and the other did not. The observed processing outcome is saved for this specific multi-value INSERT; the article does not promise an arbitrary UPDATE will visit records in a chosen business order.

Separate retained from committed

After the FAIL error, the fixture still reports an active transaction. Retained row 2 is visible to the connection used for the replay, but the test has not committed it. Describing that row as published, durable, or delivered to another system would exceed the evidence.

The same distinction applies to row 90 in both cases. Its presence after the error proves that earlier transaction work survived the statement failure. It does not establish that the whole transaction finished successfully. A job-import interface should preserve both the row observation and the transaction state in its explanation.

Apply the declared rollback policy

The proposed import policy in this example treats either constraint failure as a reason to abandon the whole current import transaction. After inspecting each error state, the fixture issues an explicit ROLLBACK. Both databases then contain only row 1/base, and neither connection reports an active transaction.

This cleanup removes row 90 in both cases and row 2 in the FAIL case. The baseline remains because it was committed before BEGIN. The policy is an editorial choice for the fictional import contract, rather than an assertion that every application should discard all previous work whenever one row fails.

Keep transaction control unambiguous

SQLite's transaction reference distinguishes explicit BEGIN scopes from automatically managed transactions and describes COMMIT and ROLLBACK as transaction-ending operations. The fixture uses a Python connection configured with isolation_level=None and sends BEGIN and ROLLBACK explicitly, avoiding an unspoken wrapper-managed transaction boundary.

A production helper should inspect the transaction behavior of its actual database wrapper before adapting this example. A context manager that rolls back on an escaping exception, a handler that catches the exception inside that context, or a separate commit call can alter what the surrounding application ultimately preserves. None of those wrapper paths was exercised here.

Save the state that explains recovery

The replay receipt records the schema, precommitted row, earlier statement, complete failing statement, selected algorithm, exception class and extended error name, rows visible immediately afterward, active-transaction flag, and rows after explicit rollback. Python 3.14.7 used SQLite 3.50.4 for this isolated run.

The practical lesson is to reconcile the database state before deciding what an import error means. A failed statement can leave different pending rows under ABORT and FAIL. Recording that boundary allows a job-import helper to choose a deliberate recovery path instead of reporting that nothing changed merely because an exception was raised.

Sources checked November 18, 2026:

SQLite, The ON CONFLICT Clause:

https://www.sqlite.org/lang_conflict.html

SQLite, Transaction:

https://www.sqlite.org/lang_transaction.html

The jobs, references, executed fixture, import policy, and receipt design are original T-800 editorial work. No real job import, cross-connection visibility test, physical action, or performance benchmark was performed.

Illustration: an AI-generated conceptual comparison shows pending same-connection rows after two failed statements. It is not an actual database dashboard or evidence that any robot job was executed.