Commit e4373460 authored by webchick's avatar webchick
Browse files

#715094 by Damien Tournoud: Fixed Transaction data need to be reset early in...

#715094 by Damien Tournoud: Fixed Transaction data need to be reset early in DatabaseConnection::popTransaction().
parent 1fed2bf2
......@@ -972,6 +972,13 @@ public function popTransaction() {
if ($this->transactionLayers == 0) {
if ($this->willRollback) {
// Reset the rollback status so that the next transaction starts clean.
$this->willRollback = FALSE;
// Reset the error log.
$rollback_logs = $this->rollbackLogs;
$this->rollbackLogs = array();
$logging = Database::getLoggingCallback();
$logging_callback = NULL;
if (is_array($logging)) {
......@@ -994,16 +1001,10 @@ public function popTransaction() {
if (isset($logging_callback)) {
// Play back the logged errors to the specified logging callback post-
// rollback.
foreach ($this->rollbackLogs as $log_item) {
foreach ($rollback_logs as $log_item) {
$logging_callback($log_item['type'], $log_item['message'], $log_item['variables'], $log_item['severity'], $log_item['link']);
}
}
// Reset any scheduled rollback.
$this->willRollback = FALSE;
// Reset the error logs.
$this->rollbackLogs = array();
}
elseif ($this->supportsTransactions()) {
parent::commit();
......
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