I am not happy with the Wikipedia article about nested transactions.

I would not use the word "commit" for a nested transaction.

For me "commit" means "durability". A nested transaction does not provide durability.

  1. Is it ok to use the word "commit" for nested transactions?
  2. What word could be used, if it is not ok?
  • @a_horse_with_no_name according to wikipedia savepoints are a way to implement nested transactions. I thought postgres supports nested transactions since it supports savepoints: "A savepoint is a way of implementing subtransactions (also known as nested transactions) within a relational database management system by indicating a point within a transaction that can be "rolled back to" without affecting any work done in the transaction before the savepoint was created."
    – guettli
    Sep 1 '15 at 9:13
  • To me a savepoint is something (completely) different than a nested transaction, but that might just be me. Sep 1 '15 at 9:15
  • 1
    Commit means much more than durability, which isn't even a requirement in its usual sense (think pure in-memory databases). Transactions are about atomicity and isolation/visibility of changes.
    – Mat
    Sep 1 '15 at 9:32

I don't think there is a problem using the word commit and personally I don't see a better wording for the concept.

Most database systems do not support nested transactions, the only one I could find is BerkelyDB.

In their documentation on nested transactions they are using commit as the term.

Committing a nested transaction has no effect on the state of the parent transaction.

In the book Concepts and Applications of Multilevel Transactions and Open Nested Transactions (1992) they seem to be using the same wording.

subtransactions can be made persistent independently of their commit state


Is it ok to use the word "commit" for nested transactions?

I think so. The syntax is still COMMIT TRANSACTION or COMMIT WORK. How 'commits' of nested transactions are handled is implementation-dependent, but it seems common to treat them as a no-op. Handling nested rollbacks is much more interesting. In SQL Server at least, it requires marking a savepoint to rollback to, if the intention is to undo only the locally-scoped work.

What word could be used, if it is not ok?

It's probably simpler just to use 'commit', adding a note or clarification about the ACID properties where the context demands it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.