database transaction rollback processing in PHP

Posted by user198729 on Stack Overflow See other posts from Stack Overflow or by user198729
Published on 2010-03-02T21:13:13Z Indexed on 2010/04/26 0:13 UTC
Read the original article Hit count: 182

Filed under:
|
|
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?

© Stack Overflow or respective owner

Related posts about php

Related posts about database