Skip to content

Instantly share code, notes, and snippets.

@raphaeldealmeida
Created February 15, 2012 21:55
Show Gist options
  • Save raphaeldealmeida/1839261 to your computer and use it in GitHub Desktop.
Save raphaeldealmeida/1839261 to your computer and use it in GitHub Desktop.
transação sem closure
<?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