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

Fix processPostTransactionCallbacks #21

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}

}
Loading