File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ class ConnectionAdapter implements IDBConnection {
2626 /** @var Connection */
2727 private $ inner ;
2828
29+ /**
30+ * The currently active transaction isolation level or NULL before it has been determined.
31+ *
32+ * @var \Doctrine\DBAL\TransactionIsolationLevel::*|null
33+ */
34+ private ?int $ transactionIsolationLevel = null ;
35+
2936 public function __construct (Connection $ inner ) {
3037 $ this ->inner = $ inner ;
3138 }
@@ -262,4 +269,14 @@ public function getShardDefinition(string $name): ?ShardDefinition {
262269 public function getCrossShardMoveHelper (): CrossShardMoveHelper {
263270 return $ this ->inner ->getCrossShardMoveHelper ();
264271 }
272+
273+ public function setTransactionIsolation (int $ level ): int {
274+ $ this ->transactionIsolationLevel = $ level ;
275+
276+ return $ this ->executeStatement ($ this ->getDatabasePlatform ()->getSetTransactionIsolationSQL ($ level ));
277+ }
278+
279+ public function getTransactionIsolation (): int {
280+ return $ this ->transactionIsolationLevel ??= $ this ->getDatabasePlatform ()->getDefaultTransactionIsolationLevel ();
281+ }
265282}
Original file line number Diff line number Diff line change @@ -388,4 +388,26 @@ public function getShardDefinition(string $name): ?ShardDefinition;
388388 * @since 30.0.0
389389 */
390390 public function getCrossShardMoveHelper (): CrossShardMoveHelper ;
391+
392+ /**
393+ * Sets the transaction isolation level.
394+ *
395+ * @param \Doctrine\DBAL\TransactionIsolationLevel::* $level The level to set.
396+ *
397+ * @throws \Doctrine\DBAL\Exception
398+ *
399+ * @since 33.0.0
400+ */
401+ public function setTransactionIsolation (int $ level ): int ;
402+
403+ /**
404+ * Gets the currently active transaction isolation level.
405+ *
406+ * @return \Doctrine\DBAL\TransactionIsolationLevel::* The current transaction isolation level.
407+ *
408+ * @throws \Doctrine\DBAL\Exception
409+ *
410+ * @since 33.0.0
411+ */
412+ public function getTransactionIsolation (): int ;
391413}
You can’t perform that action at this time.
0 commit comments