// SQLite error reference

SQLITE_ABORT_ROLLBACK: statement aborted by ROLLBACK

A statement failed because the transaction it was running in was rolled back while it was still pending, for example by a ROLLBACK on the same connection.

Result code
SQLITE_ABORT_ROLLBACK
Name
516
Category
Extended result codes
Error message
abort due to ROLLBACK

What it means

SQLITE_ABORT_ROLLBACK (516) means a statement was aborted because the transaction that was active when it started was rolled back. Pending writes always fail this way after a rollback; a pending read fails only if the schema changed inside the transaction being rolled back. The text is abort due to ROLLBACK.

Common causes

  • Calling ROLLBACK while another statement on the same connection is still being stepped.
  • An error elsewhere that made the application (or SQLite, for example after an INTERRUPT or ON CONFLICT ROLLBACK) roll back the transaction.

How to fix it

  1. Finish or reset all statements on a connection before rolling back its transaction.

  2. Look for the earlier error that triggered the rollback and fix that; this error is a consequence.

Related errors

More extended result codes errors

The code and message text are from the SQLite result and error codes documentation. Browse the full SQLite error list or search every database error.

// fewer errors, faster fixes

Work on SQLite in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQLite and the other databases you use.