diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index 5a88f6bea..e5eb5def3 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -69,6 +69,19 @@ public protocol DatabaseReader: AnyObject { /// try Player(...).insert(db) // throws SQLITE_INTERRUPT /// } catch { } /// } // throws SQLITE_ABORT + /// + /// When an application creates transaction without a transaction-wrapping + /// method, no SQLITE_ABORT error warns of aborted transactions: + /// + /// try dbQueue.inDatabase { db in // or dbPool.writeWithoutTransaction + /// try db.beginTransaction() + /// do { + /// // interrupted: + /// try Player(...).insert(db) // throws SQLITE_INTERRUPT + /// } catch { } + /// try Player(...).insert(db) // success + /// try db.commit() // throws SQLITE_ERROR "cannot commit - no transaction is active" + /// } func interrupt() // MARK: - Read From Database