Mention timer caveat in transaction docs

This commit is contained in:
Simon Binder 2024-04-22 21:52:14 +02:00
parent f9a163532b
commit 428de9354a
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,9 @@ There are a couple of things that should be kept in mind when working with trans
on the transaction after it has been closed! This can cause data loss or runtime crashes.
Drift contains some runtime checks against this misuse and will throw an exception when a transaction
is used after being closed.
A transaction is active during all asynchronous calls made in a `transaction` block, so transactions
also can't schedule timers or other operations using the database (as those would try to use the
transaction after the main `transaction` block has completed).
2. __Different behavior of stream queries__: Inside a `transaction` callback, stream queries behave
differently. If you're creating streams inside a transaction, check the next section to learn how
they behave.