File tree Expand file tree Collapse file tree 5 files changed +46
-3
lines changed
Expand file tree Collapse file tree 5 files changed +46
-3
lines changed Original file line number Diff line number Diff line change @@ -1529,4 +1529,18 @@ public function getSupportForTTLIndexes(): bool
15291529 {
15301530 return false ;
15311531 }
1532+
1533+ /**
1534+ * Does the adapter support transaction retries?
1535+ *
1536+ * @return bool
1537+ */
1538+ abstract public function getSupportForTransactionRetries (): bool ;
1539+
1540+ /**
1541+ * Does the adapter support nested transactions?
1542+ *
1543+ * @return bool
1544+ */
1545+ abstract public function getSupportForNestedTransactions (): bool ;
15321546}
Original file line number Diff line number Diff line change @@ -3692,6 +3692,16 @@ public function getSupportForTTLIndexes(): bool
36923692 return true ;
36933693 }
36943694
3695+ public function getSupportForTransactionRetries (): bool
3696+ {
3697+ return false ;
3698+ }
3699+
3700+ public function getSupportForNestedTransactions (): bool
3701+ {
3702+ return false ;
3703+ }
3704+
36953705 protected function isExtendedISODatetime (string $ val ): bool
36963706 {
36973707 /**
Original file line number Diff line number Diff line change @@ -703,4 +703,14 @@ public function getSupportForTTLIndexes(): bool
703703 {
704704 return $ this ->delegate (__FUNCTION__ , \func_get_args ());
705705 }
706+
707+ public function getSupportForTransactionRetries (): bool
708+ {
709+ return $ this ->delegate (__FUNCTION__ , \func_get_args ());
710+ }
711+
712+ public function getSupportForNestedTransactions (): bool
713+ {
714+ return $ this ->delegate (__FUNCTION__ , \func_get_args ());
715+ }
706716}
Original file line number Diff line number Diff line change @@ -3577,4 +3577,14 @@ public function getLockType(): string
35773577
35783578 return '' ;
35793579 }
3580+
3581+ public function getSupportForTransactionRetries (): bool
3582+ {
3583+ return true ;
3584+ }
3585+
3586+ public function getSupportForNestedTransactions (): bool
3587+ {
3588+ return true ;
3589+ }
35803590}
Original file line number Diff line number Diff line change 77use Utopia \Cache \Adapter \Redis as RedisAdapter ;
88use Utopia \Cache \Cache ;
99use Utopia \CLI \Console ;
10- use Utopia \Database \Adapter \Mongo ;
1110use Utopia \Database \Database ;
1211use Utopia \Database \Document ;
1312use Utopia \Database \Exception as DatabaseException ;
@@ -907,7 +906,7 @@ public function testTransactionStateAfterRetriesExhausted(): void
907906 /** @var Database $database */
908907 $ database = $ this ->getDatabase ();
909908
910- if ($ database ->getAdapter () instanceof Mongo ) {
909+ if (! $ database ->getAdapter ()-> getSupportForTransactionRetries () ) {
911910 $ this ->expectNotToPerformAssertions ();
912911 return ;
913912 }
@@ -945,7 +944,7 @@ public function testNestedTransactionState(): void
945944 /** @var Database $database */
946945 $ database = $ this ->getDatabase ();
947946
948- if ($ database ->getAdapter () instanceof Mongo ) {
947+ if (! $ database ->getAdapter ()-> getSupportForNestedTransactions () ) {
949948 $ this ->expectNotToPerformAssertions ();
950949 return ;
951950 }
You can’t perform that action at this time.
0 commit comments