Paul Boddie wrote:
On 21 Mai, 15:22, [EMAIL PROTECTED] wrote:
I did and I confirmed this by modifying the data, selecting it from
the mysql command line client to verify the changes, then running the
report again. If I exit the application and then start it again,
everything works as expected until the second instance of the report
is run.
Note that if you have a connection open in your program, especially if
that connection has already been used to select data, it may be the
case that you then have to perform a rollback or commit before
attempting to access newly added data.
Exactly. Although it seems counterintutive, it's not enough
to do a COMMIT after UPDATE and INSERT operations. You also have to
do a COMMIT after a SELECT if you're going to reuse the database handle
and do another SELECT. Otherwise, you reread the same data forever.
COMMIT, by the way, is per database handle, so if you have
multiple database handles, each needs to handle its own COMMIT needs.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list