Jira issue originally created by user @doctrinebot:
This issue is created automatically through a Github pull request on behalf of BenMorel:
This is a first draft on the idea of a Transaction object, as suggested by @guilhermeblanco and @beberlei in doctrine/doctrine2#949.
This makes the following changes to Connection:
The new way of dealing with transactions is then:
$transaction = $connection->createTransaction();
It also automatically propagates commit() and rollback() to nested transactions:
$transaction1 = $connection->createTransaction();
$transaction2 = $connection->createTransaction();
$transaction1->commit(); // will commit $transaction2 then $transaction1
Overall, it's not a complicated change, does not introduce any BC break, and passes all existing tests.
I'm looking forward to hearing what you think!
Comment created by @doctrinebot:
A related Github Pull-Request [GH-571] was closed: