OnlineBuddies/PDO-Wrapper — pull request #17 by iarna (2013-05-17 21:07:56+00:00)
Title: Nested transactions via SAVEPOINTs

Turns out, nested transactions in MySQL is super easy to implement.

Plusses: This adds support for SAVEPOINTS transparently to beginTransaction/commit/rollBack.

Minuses: This makes using an interface other then execTransaction more potentially error prone, that is, you can leak transactions. On the other hand, more and more I'm convinced that you should never ever be using beginTransaction/commit/rollBack– I think they're the GOTOs of SQL, that is, they're excellent primitives for building actual language constructs from.