title: Python | SQLite3: Is commit used on the connect or cursor?
body: <p>I'm in the process of learning python and sqlite3 through a book named Practical Programming: 2nd Edition.
  Within the book itself, it has conflicting code.</p>
  
  <p>If this is the start of my code:</p>
  
  <pre><code>import sqlite3
  
  con = sqlite3.connect('stackoverflow.db')
  
  cur = conn.cursor()
  </code></pre>
  
  <p>To commit, would I use con.commit(), or cur.commit(). Or are there different times to use the different one?</p>
  
  <p>Here are pictures from the book:</p>
  
  <p>This shows con.commit()
  <a href="https://i.stack.imgur.com/yzwLm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yzwLm.png" alt="con commit"></a></p>
  
  <p>This shows cur.commit()
  <a href="https://i.stack.imgur.com/wdc8k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wdc8k.png" alt="cur.commit()"></a></p>
  
  <p>I checked online at <a href="https://docs.python.org/3/library/sqlite3.html" rel="nofollow noreferrer">https://docs.python.org/3/library/sqlite3.html</a> and shows con.commit()
  <a href="https://i.stack.imgur.com/OyLKS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OyLKS.png" alt="enter image description here"></a></p>
  
  <p>Just wanna make sure whether the book has an error of using <code>cur.commit()</code>, or whether there is a special condition to use it.</p>
  
  <p>Thanks in advance</p>