SQLite3, data not found

Jerry Hill malaclypse2 at gmail.com
Fri Mar 16 23:23:59 CET 2007


On 3/16/07, jim-on-linux <inq1ltd at verizon.net> wrote:
> Below, the first select produces results but,
> after closing then re-opening the database the
> select produces an empty list.  Anyone know the
> reason ??

When you first open a connection, you implicitly begin a transaction.
You need to call con.commit() before you close the connection, or your
transaction will be rolled back when you close() it.  If don't want to
bother with transaction handling, you can turn it off when you open
the connection, like this:
con = sqlite3.connect('myData', isolation_level=None)

See the Python Database API 2.0 PEP for more details about the
behavior required of DB-API 2.0 compliant interfaces:
http://www.python.org/dev/peps/pep-0249/

-- 
Jerry



More information about the Python-list mailing list