PHP PDO transaction automatic rollBack -
i refining code on 1 of applications converted using php adodb library pdo lately. in adodb once launched transaction automatically rolled if exception should arise queries between begin , commit commands.
does pdo this. if method has query it fails between begin , commit in pdo trsaction automatically rollback or need implicitly called?
you have call rollback (and commit) yourself, pdo
won't you. this:
$pdo = new \pdo(/* ... */); $pdo->begintransaction(); try { // stuff.. } catch(\exception $e) { $pdo->rollback(); throw $e; } $pdo->commit();
Comments
Post a Comment