Created
February 15, 2012 21:55
-
-
Save raphaeldealmeida/1839261 to your computer and use it in GitHub Desktop.
transação sem closure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$em->getConnection()->beginTransaction(); | |
try{ | |
//... | |
$em->persist($user); | |
$em->flush(); | |
$em->getConnection()->commit(); | |
}catch(Exception $e){ | |
$em->getConnection()->rollback(); | |
$em->close(); | |
throw $e; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment