改进Connection类的事务方法

This commit is contained in:
thinkphp
2016-05-31 18:03:48 +08:00
parent bf59fd8097
commit c3d673dab4

View File

@@ -545,9 +545,9 @@ abstract class Connection
} }
$this->commit($label); $this->commit($label);
return $result; return $result;
} catch (\PDOException $e) { } catch (\Exception $e) {
$this->rollback(); $this->rollback();
return false; throw $e;
} }
} }
@@ -570,7 +570,7 @@ abstract class Connection
$this->linkID->beginTransaction(); $this->linkID->beginTransaction();
} }
$this->transTimes++; $this->transTimes++;
return null; return;
} }
/** /**