mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Using dbo methods to manage the transaction.
This commit is contained in:
parent
82e2d9e271
commit
f0db55de6f
1 changed files with 2 additions and 2 deletions
|
@ -619,12 +619,12 @@ class Mssql extends DboSource {
|
|||
|
||||
$table = $this->fullTableName($table);
|
||||
$fields = implode(', ', array_map(array(&$this, 'name'), $fields));
|
||||
$this->_connection->beginTransaction();
|
||||
$this->begin();
|
||||
foreach ($values as $value) {
|
||||
$holder = implode(', ', array_map(array(&$this, 'value'), $value));
|
||||
$this->_execute("INSERT INTO {$table} ({$fields}) VALUES ({$holder})");
|
||||
}
|
||||
$this->_connection->commit();
|
||||
$this->commit();
|
||||
|
||||
if ($hasPrimaryKey) {
|
||||
$this->_execute('SET IDENTITY_INSERT ' . $this->fullTableName($table) . ' OFF');
|
||||
|
|
Loading…
Reference in a new issue