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

Commit

Permalink
Fix processPostTransactionCallbacks (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
mondrake authored Aug 30, 2023
1 parent fd902b9 commit fc6d55f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ jobs:
- name: Run tests ${{ matrix.test-args }}
continue-on-error: true
run: vendor/bin/phpunit -c core --color=always ${{ matrix.test-args }}

# run: vendor/bin/phpunit -c core --color=always ${{ matrix.test-args }}
run: vendor/bin/phpunit -c core --color=always modules/contrib/mysqli/tests/src/Kernel/mysqli/TransactionTest.php
# - uses: actions/upload-artifact@v3
# with:
# name: test-results
Expand Down
7 changes: 0 additions & 7 deletions src/Driver/Database/mysqli/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,4 @@ protected function driverTransactionManager(): TransactionManagerInterface {
return new TransactionManager($this);
}

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

}
14 changes: 12 additions & 2 deletions src/Driver/Database/mysqli/TransactionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,24 @@ protected function releaseClientSavepoint(string $name): bool {
* {@inheritdoc}
*/
protected function rollbackClientTransaction(): bool {
return $this->connection->getClientConnection()->rollback();
$clientRollback = $this->connection->getClientConnection()->rollBack();
$this->setConnectionTransactionState($clientRollback ?
ClientConnectionTransactionState::RolledBack :
ClientConnectionTransactionState::RollbackFailed
);
return $clientRollback;
}

/**
* {@inheritdoc}
*/
protected function commitClientTransaction(): bool {
return $this->connection->getClientConnection()->commit();
$clientCommit = $this->connection->getClientConnection()->commit();
$this->setConnectionTransactionState($clientCommit ?
ClientConnectionTransactionState::Committed :
ClientConnectionTransactionState::CommitFailed
);
return $clientCommit;
}

}

0 comments on commit fc6d55f

Please sign in to comment.