diff --git a/GRDB/Core/TransactionObserver.swift b/GRDB/Core/TransactionObserver.swift index e0d18226a..8cddd2984 100644 --- a/GRDB/Core/TransactionObserver.swift +++ b/GRDB/Core/TransactionObserver.swift @@ -778,7 +778,8 @@ public protocol TransactionObserver: AnyObject { /// - note: The event is only valid for the duration of this method call. /// If you need to keep it longer, store a copy: `event.copy()`. /// - /// - precondition: This method must not access the database. + /// - precondition: This method must not access the observed writer + /// database connection. func databaseDidChange(with event: DatabaseEvent) /// Called when a transaction is about to be committed. @@ -786,7 +787,8 @@ public protocol TransactionObserver: AnyObject { /// The transaction observer has an opportunity to rollback pending changes /// by throwing an error from this method. /// - /// - precondition: This method must not access the database. + /// - precondition: This method must not access the observed writer + /// database connection. /// - throws: The eventual error that rollbacks pending changes. func databaseWillCommit() throws diff --git a/GRDB/Documentation.docc/Extension/TransactionObserver.md b/GRDB/Documentation.docc/Extension/TransactionObserver.md index feaf9f9c2..026833eac 100644 --- a/GRDB/Documentation.docc/Extension/TransactionObserver.md +++ b/GRDB/Documentation.docc/Extension/TransactionObserver.md @@ -97,7 +97,7 @@ do { - Note: All callbacks are called in the writer dispatch queue, and serialized with all database updates. -- Note: The `databaseDidChange` and `databaseWillCommit` callbacks must not touch the SQLite database. This limitation does not apply to `databaseDidCommit` and `databaseDidRollback` which can use their database argument. +- Note: The `databaseDidChange` and `databaseWillCommit` callbacks must not access the observed writer database connection in any way. This limitation does not apply to `databaseDidCommit` and `databaseDidRollback` which can use their database argument. ## Filtering Database Events