Skip to content

Commit

Permalink
Add option to configure MARS on SqlServer Connections
Browse files Browse the repository at this point in the history
As stated in this docs from Microsoft:

https://github.com/Microsoft/msphpsql/wiki/Recommendations-for-improving-the-performance-of-PDO_SQLSRV-and-SQLSRV#1-multiple-active-result-sets-mars

> MARS is enabled by default in both SQLSRV and PDO_SQLSRV drivers. There can be some performance drop when MARS is enabled. Existing code optimized to run in the non-MARS world may show a performance dip when run un-modified with MARS.

This PR adds the ability to configure MARS on a SqlServer connection
  • Loading branch information
rodrigopedra authored Jul 17, 2017
1 parent 698a635 commit c27a982
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Database/Connectors/SqlServerConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ protected function getSqlSrvDsn(array $config)
$arguments['TrustServerCertificate'] = $config['trust_server_certificate'];
}

if (isset($config['multiple_active_resultsets']) && $config['multiple_active_resultsets'] === false) {
$arguments['MultipleActiveResultSets'] = 'false';
}

return $this->buildConnectString('sqlsrv', $arguments);
}

Expand Down

0 comments on commit c27a982

Please sign in to comment.