diff --git a/README.md b/README.md index 04978f588..96bd31db1 100644 --- a/README.md +++ b/README.md @@ -1053,7 +1053,7 @@ try dbQueue.inTransaction { db in } ``` -A ROLLBACK statement is issued if an error is thrown within the transaction block. +The transaction is rollbacked if an error is thrown within the transaction body, and that error is rethrown by the inTransaction method. If you want to insert a transaction between other database statements, you can use the Database.inTransaction() function: @@ -1106,6 +1106,8 @@ try dbQueue.inTransaction { db in } ``` +The savepoint is rollbacked if an error is thrown within the savepoint body, and that error is rethrown by the inSavepoint method. + **Unlike transactions, savepoints can be nested.** They implicitly open a transaction if no one was opened when the savepoint begins. As such, they behave just like nested transactions. Yet the database changes are only committed to disk when the outermost savepoint is committed: ```swift