# X_DB_TRANSACTION_ABORTED

## Means

the server rolled the transaction back

## Typical cause

a statement failed inside withTransaction and the body caught it instead of rethrowing; Postgres aborts the whole transaction on any statement error, so COMMIT answers ROLLBACK and nothing is stored

## Fix

`await withTransaction(() => fallible()).catch(fallback)` — a nested scope is a SAVEPOINT: only it rolls back — or rethrow the statement error

[Entity and database](/error-codes#entity-and-database)
