Commit b6a07b65 authored by doctrine's avatar doctrine

PDOException now wrapped into Doctrine_Exception, transaction rollback...

PDOException now wrapped into Doctrine_Exception, transaction rollback whenever PDOException is thrown
parent 15135c68
......@@ -472,6 +472,7 @@ abstract class Doctrine_Session extends Doctrine_Configurable implements Countab
if($this->getAttribute(Doctrine::ATTR_VLD))
$this->validator = new Doctrine_Validator();
try {
$this->bulkInsert();
$this->bulkUpdate();
......@@ -484,6 +485,11 @@ abstract class Doctrine_Session extends Doctrine_Configurable implements Countab
}
}
} catch(PDOException $e) {
$this->rollback();
throw new Doctrine_Exception($e->getMessage());
}
$this->dbh->commit();
$this->getAttribute(Doctrine::ATTR_LISTENER)->onTransactionCommit($this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment