Skip to content

Commit 4ac1ab7

Browse files
Clean up mysqli transactions (#9888)
1 parent 5a65ee3 commit 4ac1ab7

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

system/Database/MySQLi/Connection.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,6 @@ public function insertID(): int
610610
*/
611611
protected function _transBegin(): bool
612612
{
613-
$this->connID->autocommit(false);
614-
615613
return $this->connID->begin_transaction();
616614
}
617615

@@ -620,26 +618,14 @@ protected function _transBegin(): bool
620618
*/
621619
protected function _transCommit(): bool
622620
{
623-
if ($this->connID->commit()) {
624-
$this->connID->autocommit(true);
625-
626-
return true;
627-
}
628-
629-
return false;
621+
return $this->connID->commit();
630622
}
631623

632624
/**
633625
* Rollback Transaction
634626
*/
635627
protected function _transRollback(): bool
636628
{
637-
if ($this->connID->rollback()) {
638-
$this->connID->autocommit(true);
639-
640-
return true;
641-
}
642-
643-
return false;
629+
return $this->connID->rollback();
644630
}
645631
}

0 commit comments

Comments
 (0)