Original file line numberDiff line numberDiff line change@@ -360,21 +360,20 @@ Connection Objects
360360361361 .. method:: commit()
362362363- This method commits the current transaction. If you don't call this method,
364- anything you did since the last call to ``commit()`` is not visible from
365- other database connections. If you wonder why you don't see the data you've
366- written to the database, please check you didn't forget to call this method.
363+ Commit any pending transaction to the database.
364+ If there is no open transaction, this method is a no-op.
367365368366 .. method:: rollback()
369367370-This method rolls back any changes to the database since the last call to
371-:meth:`commit`.
368+Roll back to the start of any pending transaction.
369+If there is no open transaction, this method is a no-op.
372370373371 .. method:: close()
374372375- This closes the database connection. Note that this does not automatically
376- call :meth:`commit`. If you just close your database connection without
377- calling :meth:`commit` first, your changes will be lost!
373+ Close the database connection.
374+ Any pending transaction is not committed implicitly;
375+ make sure to :meth:`commit` before closing
376+ to avoid losing pending changes.
378377379378 .. method:: execute(sql[, parameters])
380379Original file line numberDiff line numberDiff line change@@ -351,12 +351,14 @@ pysqlite_connection_cursor_impl(pysqlite_Connection *self, PyObject *factory)
351351/*[clinic input]
352352_sqlite3.Connection.close as pysqlite_connection_close
353353354-Closes the connection.
354+Close the database connection.
355+356+Any pending transaction is not committed implicitly.
355357[clinic start generated code]*/
356358357359staticPyObject*
358360pysqlite_connection_close_impl(pysqlite_Connection*self)
359-/*[clinic end generated code: output=a546a0da212c9b97 input=3d58064bbffaa3d3]*/
361+/*[clinic end generated code: output=a546a0da212c9b97 input=b3ed5b74f6fefc06]*/
360362{
361363intrc;
362364@@ -445,12 +447,14 @@ PyObject* _pysqlite_connection_begin(pysqlite_Connection* self)
445447/*[clinic input]
446448_sqlite3.Connection.commit as pysqlite_connection_commit
447449448-Commit the current transaction.
450+Commit any pending transaction to the database.
451+452+If there is no open transaction, this method is a no-op.
449453[clinic start generated code]*/
450454451455staticPyObject*
452456pysqlite_connection_commit_impl(pysqlite_Connection*self)
453-/*[clinic end generated code: output=3da45579e89407f2 input=39c12c04dda276a8]*/
457+/*[clinic end generated code: output=3da45579e89407f2 input=c8793c97c3446065]*/
454458{
455459intrc;
456460sqlite3_stmt*statement;
@@ -494,12 +498,14 @@ pysqlite_connection_commit_impl(pysqlite_Connection *self)
494498/*[clinic input]
495499_sqlite3.Connection.rollback as pysqlite_connection_rollback
496500497-Roll back the current transaction.
501+Roll back to the start of any pending transaction.
502+503+If there is no open transaction, this method is a no-op.
498504[clinic start generated code]*/
499505500506staticPyObject*
501507pysqlite_connection_rollback_impl(pysqlite_Connection*self)
502-/*[clinic end generated code: output=b66fa0d43e7ef305 input=12d4e8d068942830]*/
508+/*[clinic end generated code: output=b66fa0d43e7ef305 input=7f60a2f1076f16b3]*/
503509{
504510intrc;
505511sqlite3_stmt*statement;