diff --git a/src/transaction.rs b/src/transaction.rs index 41414f7..7e3e012 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -94,6 +94,9 @@ pub struct Savepoint<'conn> { impl<'conn> Transaction<'conn> { /// Begin a new transaction. Cannot be nested; see `savepoint` for nested transactions. + // Even though we don't mutate the connection, we take a `&mut Connection` + // so as to prevent nested or concurrent transactions on the same + // connection. pub fn new(conn: &mut Connection, behavior: TransactionBehavior) -> Result { let query = match behavior { TransactionBehavior::Deferred => "BEGIN DEFERRED",