Want to share one kind a weir thing I found today.
I’m long time use transactions in Mysql, but never run in case when transaction is opened, but not closed.And today in the testing process I have found that if you start transaction and then your script dies in a middle for any reason and it is not catched by exception which calls rollback, all data you have modified are PRESENT in db. So Mysql commits it automatically by default. And even more: all data modified INSIDE transaction are available to other connections IMMEDIATELY. So you risky to have inconsistent data in parallel queries. So seems like classic transaction model was avoided by default.
You need to setup autocommit = 0 manually after each connect to avoid it.
Maybe it is really easier for dummies who forget to close transaction by commit, but i was frustrated when i saw that.
So if you really need to use classical transaction model in Mysql 5 you need after each connect use following SQL statement:
SET autocommit = 0
For more detailed reference you can visit official page: