Skip to content

Commit

Permalink
Revert "fix(db): Set transaction isolation level for replica connecti…
Browse files Browse the repository at this point in the history
…ons too"

This reverts commit db0fa54.
  • Loading branch information
ChristophWurst committed May 24, 2024
1 parent 38aac68 commit b735389
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/private/DB/SetTransactionIsolationLevel.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ class SetTransactionIsolationLevel implements EventSubscriber {
*/
public function postConnect(ConnectionEventArgs $args) {
$connection = $args->getConnection();
$connection->setTransactionIsolation(TransactionIsolationLevel::READ_COMMITTED);
if ($connection->getDatabasePlatform() instanceof MySQLPlatform) {
$connection->executeStatement('SET SESSION AUTOCOMMIT=1');
if ($connection instanceof PrimaryReadReplicaConnection && $connection->isConnectedToPrimary()) {
$connection->setTransactionIsolation(TransactionIsolationLevel::READ_COMMITTED);
if ($connection->getDatabasePlatform() instanceof MySQLPlatform) {
$connection->executeStatement('SET SESSION AUTOCOMMIT=1');
}
}
}

Expand Down

0 comments on commit b735389

Please sign in to comment.