Skip to content

Instantly share code, notes, and snippets.

@rchavik
Created October 7, 2015 09:30
Show Gist options
  • Save rchavik/7618629b3149be79b7da to your computer and use it in GitHub Desktop.
Save rchavik/7618629b3149be79b7da to your computer and use it in GitHub Desktop.
mysqlnd_ms support
diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php
index a01cee6..6204755 100644
--- a/lib/Cake/Model/Datasource/DboSource.php
+++ b/lib/Cake/Model/Datasource/DboSource.php
@@ -2304,6 +2304,7 @@ class DboSource extends DataSource {
if ($this->fullDebug) {
$this->logQuery('BEGIN');
}
+ $this->_connection->setAttribute(PDO::ATTR_AUTOCOMMIT, false);
return $this->_transactionStarted = $this->_connection->beginTransaction();
}
@@ -2338,7 +2339,9 @@ class DboSource extends DataSource {
$this->logQuery('COMMIT');
}
$this->_transactionStarted = false;
- return $this->_connection->commit();
+ $res = $this->_connection->commit();
+ $this->_connection->setAttribute(PDO::ATTR_AUTOCOMMIT, true);
+ return $res;
}
if ($this->nestedTransactionSupported()) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment