Skip to content

Commit ce07bbb

Browse files
committed
Clean up mysqli transactions
1 parent 5ab52ae commit ce07bbb

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
@@ -625,8 +625,6 @@ public function insertID(): int
625625
*/
626626
protected function _transBegin(): bool
627627
{
628-
$this->connID->autocommit(false);
629-
630628
return $this->connID->begin_transaction();
631629
}
632630

@@ -635,26 +633,14 @@ protected function _transBegin(): bool
635633
*/
636634
protected function _transCommit(): bool
637635
{
638-
if ($this->connID->commit()) {
639-
$this->connID->autocommit(true);
640-
641-
return true;
642-
}
643-
644-
return false;
636+
return $this->connID->commit();
645637
}
646638

647639
/**
648640
* Rollback Transaction
649641
*/
650642
protected function _transRollback(): bool
651643
{
652-
if ($this->connID->rollback()) {
653-
$this->connID->autocommit(true);
654-
655-
return true;
656-
}
657-
658-
return false;
644+
return $this->connID->rollback();
659645
}
660646
}

0 commit comments

Comments
 (0)