Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Commit

Permalink
III
Browse files Browse the repository at this point in the history
  • Loading branch information
mondrake committed Aug 30, 2023
1 parent 65f421a commit 33f610c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/Driver/Database/mysqli/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,11 @@ protected function driverTransactionManager(): TransactionManagerInterface {
return new TransactionManager($this);
}

/**
* {@inheritdoc}
*/
public function startTransaction($name = '') {
return $this->transactionManager()->push($name);
}

}
12 changes: 7 additions & 5 deletions src/Driver/Database/mysqli/TransactionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@

/**
* MySqli implementation of TransactionManagerInterface.
*
* MySQL will automatically commit transactions when tables are altered or
* created (DDL transactions are not supported). However, pdo_mysql tracks
* whether a client connection is still active and we can prevent triggering
* exceptions.
*/
class TransactionManager extends TransactionManagerBase {

Expand All @@ -24,6 +19,13 @@ protected function beginClientTransaction(): bool {
return $this->connection->getClientConnection()->begin_transaction();
}

/**
* {@inheritdoc}
*/
protected function addClientSavepoint(string $name): bool {
return $this->connection->getClientConnection()->savepoint($name);
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 33f610c

Please sign in to comment.