database transaction rollback processing in PHP
- by user198729
try
{
$con->beginTransaction();
$this->doSave($con);
$con->commit();
}
catch (Exception $e)
{
$con->rollBack();
throw $e;
}
The code above is quite standard an approach to deal with transactions,
but my question is:what if $con->rollBack() also fails?
It may cause db lock,right?If so,what's the perfect way to go?