Question
Disabling MySQL autocommit
I'm relatively new to using cftransaction but I've come
across something that I can't explain. I added "SET autocommit=0;"
to the connection string of my database in CFAdmin for a MySQL 4.1
database and restarted the service. The db is using the native
MySQL 4/5 driver.
In the code attached below and found that if I remove the <cfif commitData> logic the data is still written to the tables. If I force an db error on the second insert the data appears to roll back and not write to either table. If I remove the cftransaction rollback statement it will write the first insert but not write the second.
So, even with autocommit switched off (if I actually do have it switched off) does cfquery or something else automatically commit the data if cfcatch does not catch an error?
In the code attached below and found that if I remove the <cfif commitData> logic the data is still written to the tables. If I force an db error on the second insert the data appears to roll back and not write to either table. If I remove the cftransaction rollback statement it will write the first insert but not write the second.
So, even with autocommit switched off (if I actually do have it switched off) does cfquery or something else automatically commit the data if cfcatch does not catch an error?
