On Fri, Nov 28, 2014 at 4:44 PM, Frank Millman <fr...@chagford.com> wrote:
> There seems to be a difference between conn.commit() and
> cur.execute('commit'), which leaves the connection in a different state.

Yes, if a connection library offers a way to commit/roll back, it's
usually best to use that.

> However, for my purposes, this is academic.
>
> The main lesson I have learned is that you should always issue a commit
> after any logical set of SQL statements, even if they are only SELECTs,
> otherwise the locks are not released.

Correct. Every time you use any database, you should think in terms of
units of work, which correspond precisely to transactions.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to