Merge pull request #70 from schveiguy/patch-1

Add description of rollback without throwing error
This commit is contained in:
Gwendal Roué committed 2016-06-06 21:18:01 +02:00
commit 70deb7b388
1 file changed
+1 -1
+1 -1
View File
@@ -1060,7 +1060,7 @@ try dbQueue.inTransaction { db in
}
```
The transaction is rollbacked if an error is thrown within the transaction body, and that error is rethrown by the inTransaction method.
The transaction is rollbacked if an error is thrown within the transaction body, and that error is rethrown by the inTransaction method. If you return `TransactionCompletion.Rollback` from your closure, the transaction is also rolled back, but no error is thrown.
If you want to insert a transaction between other database statements, you can use the Database.inTransaction() function: