1
0
mirror of synced 2025-01-18 14:31:40 +03:00

PDOException now wrapped into Doctrine_Exception, transaction rollback whenever PDOException is thrown

This commit is contained in:
doctrine 2006-05-29 20:08:28 +00:00
parent 15135c689f
commit b6a07b65a5

View File

@ -472,18 +472,24 @@ 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();
$this->bulkDelete();
$this->bulkInsert();
$this->bulkUpdate();
$this->bulkDelete();
if($this->getAttribute(Doctrine::ATTR_VLD)) {
if($this->validator->hasErrors()) {
$this->rollback();
throw new Doctrine_Validator_Exception($this->validator);
if($this->getAttribute(Doctrine::ATTR_VLD)) {
if($this->validator->hasErrors()) {
$this->rollback();
throw new Doctrine_Validator_Exception($this->validator);
}
}
} catch(PDOException $e) {
$this->rollback();
throw new Doctrine_Exception($e->getMessage());
}
$this->dbh->commit();
$this->getAttribute(Doctrine::ATTR_LISTENER)->onTransactionCommit($this);