Skip to content

Instantly share code, notes, and snippets.

@cirpo
Created September 9, 2011 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirpo/1207346 to your computer and use it in GitHub Desktop.
Save cirpo/1207346 to your computer and use it in GitHub Desktop.
doctrine transaction in the action
<?php
$con = Doctrine_Manager::connection();
try
{
$con->beginTransaction();
$auction->extendExpirationTime();
$auction->incrementActualValue();
$user->decreaseTotalBids();
$con->commit();
}
catch (Exception $e)
{
//TODO log
$con->rollback();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment