Skip to content

Commit b89ce00

Browse files
committed
Document that read-only transactions are not notified
1 parent c5eba47 commit b89ce00

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6683,6 +6683,8 @@ By default, database holds weak references to its transaction observers: they ar
66836683
**A transaction observer is notified of all database changes**: inserts, updates and deletes. This includes indirect changes triggered by ON DELETE and ON UPDATE actions associated to [foreign keys](https://www.sqlite.org/foreignkeys.html#fk_actions), and [SQL triggers](https://www.sqlite.org/lang_createtrigger.html).
66846684
66856685
> :point_up: **Note**: Some changes are not notified: changes to internal system tables (such as `sqlite_master`), changes to [`WITHOUT ROWID`](https://www.sqlite.org/withoutrowid.html) tables, and the deletion of duplicate rows triggered by [`ON CONFLICT REPLACE`](https://www.sqlite.org/lang_conflict.html) clauses (this last exception might change in a future release of SQLite).
6686+
>
6687+
> :point_up: **Note**: Transactions performed during read-only database accesses are not notified.
66866688
66876689
Notified changes are not actually written to disk until the [transaction](#transactions-and-savepoints) commits, and the `databaseDidCommit` callback is called. On the other side, `databaseDidRollback` confirms their invalidation:
66886690
@@ -6794,7 +6796,7 @@ class PlayerScoreObserver: TransactionObserver {
67946796
}
67956797
```
67966798
6797-
When the `observes(eventsOfKind:)` method returns false for all event kinds, the observer is still notified of commits and rollbacks:
6799+
When the `observes(eventsOfKind:)` method returns false for all event kinds, the observer is still notified of commits and rollbacks (except during read-only database accesses):
67986800
67996801
```swift
68006802
class PureTransactionObserver: TransactionObserver {

0 commit comments

Comments
 (0)