From b7fb44a5a6321dce78e788e070125fde6b5e62db Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Thu, 7 Dec 2017 12:19:59 -0800 Subject: [PATCH] Add a comment to InProgress. --- src/conn.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/conn.rs b/src/conn.rs index 20b342b8..3cdccf29 100644 --- a/src/conn.rs +++ b/src/conn.rs @@ -205,6 +205,11 @@ impl Conn { inputs) } + /// Take a SQLite transaction. + /// IMMEDIATE means 'start the transaction now, but don't exclude readers'. It prevents other + /// connections from taking immediate or exclusive transactions. This is appropriate for our + /// writes and `InProgress`: it means we are ready to write whenever we want to, and nobody else + /// can start a transaction that's not `DEFERRED`, but we don't need exclusivity yet. pub fn begin_transaction<'m, 'conn>(&'m mut self, sqlite: &'conn mut rusqlite::Connection) -> Result> { let tx = sqlite.transaction_with_behavior(TransactionBehavior::Immediate)?; let (current_generation, current_partition_map, current_schema) =