Fun MySQL fact of the day: leveraging autocommit

By default, MySQL uses autocommit for all new connections, and, as noted yesterday, autocommit can be remarkably powerful when used carefully for two separate reasons:

I also noted that autocommit can be annoying and dangerous. And it can be: if you don't know autocommit is on and you begin making multi-statement changes, each single statement is immediately committed, potentially leaving you with a corrupt object graph if, for any reason, the application can't finish the change set.