This repository was archived by the owner on Jun 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -745,13 +745,28 @@ public function begin_transaction(): void {
745
745
*
746
746
* From the SQLite documentation:
747
747
*
748
+ * ## Read transactions versus write transactions
749
+ *
748
750
* If a write statement occurs while a read transaction is active,
749
751
* then the read transaction is upgraded to a write transaction if
750
752
* possible. If some other database connection has already modified
751
753
* the database or is already in the process of modifying the database,
752
754
* then upgrading to a write transaction is not possible and the write
753
755
* statement will fail with SQLITE_BUSY.
754
756
*
757
+ * ## DEFERRED, IMMEDIATE, and EXCLUSIVE transactions
758
+ *
759
+ * Transactions can be DEFERRED, IMMEDIATE, or EXCLUSIVE. The default
760
+ * transaction behavior is DEFERRED.
761
+ *
762
+ * DEFERRED means that the transaction does not actually start until
763
+ * the database is first accessed.
764
+ *
765
+ * IMMEDIATE causes the database connection to start a new write
766
+ * immediately, without waiting for a write statement. The BEGIN
767
+ * IMMEDIATE might fail with SQLITE_BUSY if another write transaction
768
+ * is already active on another database connection.
769
+ *
755
770
* See:
756
771
* - https://www.sqlite.org/lang_transaction.html
757
772
* - https://www.sqlite.org/rescode.html#busy
You can’t perform that action at this time.
0 commit comments