From: Raymond Hettinger Date: Tue, 25 Sep 2012 23:57:50 +0000 (-0400) Subject: Show how to close a connection X-Git-Tag: v2.7.4rc1~534 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b43274d122f7d00bf203b7820bcb18c9c173d07;p=thirdparty%2FPython%2Fcpython.git Show how to close a connection --- diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 978b7603ee5e..1ff75f05f14f 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -42,8 +42,9 @@ and call its :meth:`~Cursor.execute` method to perform SQL commands:: # Save (commit) the changes conn.commit() - # We can also close the cursor if we are done with it - c.close() + # We can also close the connection if we are done with it. + # Just be sure any changes have been committed or they will be lost. + conn.close() The data you've saved is persistent and is available in subsequent sessions::