mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
README.md
This commit is contained in:
1 parent
efddb39ff5
commit
589e2e77b1
1 file changed
+13
@@ -1035,6 +1035,19 @@ A ROLLBACK statement is issued if an error is thrown within the transaction bloc
|
||||
|
||||
Otherwise, transactions are guaranteed to succeed, *provided there is a single DatabaseQueue connected to the database file*. See [Concurrency](#concurrency) for more information about concurrent database access.
|
||||
|
||||
If you want to insert a transaction between other database statements, and group those in a single block of code protected by the the database queue, you can use the Database.inTransaction() function:
|
||||
|
||||
```swift
|
||||
try dbQueue.inDatabase { db in
|
||||
...
|
||||
try db.inTransaction {
|
||||
...
|
||||
return .Commit
|
||||
}
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Concurrency
|
||||
|
||||
|
||||
Reference in new issue
Block a user