From 428de9354afe4c8b00dbe4b0e071901afd631ce5 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Mon, 22 Apr 2024 21:52:14 +0200 Subject: [PATCH] Mention timer caveat in transaction docs --- docs/pages/docs/Dart API/transactions.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/pages/docs/Dart API/transactions.md b/docs/pages/docs/Dart API/transactions.md index d6b6dd44..4e7ab788 100644 --- a/docs/pages/docs/Dart API/transactions.md +++ b/docs/pages/docs/Dart API/transactions.md @@ -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.