3 ms·
You can set your connection (possibly your db) to autocommit. I forget how offhand, maybe do a search.
by tocomment 17y ago
You can set your connection (possibly your db) to autocommit. I forget how offhand, maybe do a search.
- mgrouchy 17y agoMySQL is set to autocommit by default (you can check with "select @@autocommit", there are probably some other ways to check as well), then it comes to which engine you use, many of them don't support transactions, but some like InnoDB do. So it really all depends. in response to lincolnq below: you are correct, if the engine does support autocommit it is turned on automatically. http://www.python.org/dev/peps/pep-0249/ http://www.python.org/dev/peps/pep-0249/
- lincolnq 17y agoMySQL may be autocommit by default, but I believe the Python DB-API spec (and therefore mysqldb) specifies to turn autocommit off when the connection is opened.