src/EntityManager/RetryConnection/PingingAndReconnectingConnection.php
private function resetTransactionNestingLevel(): void
    {
        if (!$this->selfReflectionNestingLevelProperty instanceof \ReflectionProperty) {
            $reflection                               = new \ts\Reflection\ReflectionClass(Connection::class);
            $this->selfReflectionNestingLevelProperty = $reflection->getProperty('transactionNestingLevel');
            $this->selfReflectionNestingLevelProperty->setAccessible(true);
        }

        $this->selfReflectionNestingLevelProperty->setValue($this, 0);
    }
private function resetTransactionNestingLevel(): void
    {
        if (!$this->selfReflectionNestingLevelProperty instanceof \ReflectionProperty) {
            $reflection                               = new \ts\Reflection\ReflectionClass(Connection::class);
            $this->selfReflectionNestingLevelProperty = $reflection->getProperty('transactionNestingLevel');
            $this->selfReflectionNestingLevelProperty->setAccessible(true);
        }

        $this->selfReflectionNestingLevelProperty->setValue($this, 0);
    }
private function resetTransactionNestingLevel ( ) : void { if ( ! $ this -> selfReflectionNestingLevelProperty instanceof \ ReflectionProperty ) { $ reflection = new \ ts \ Reflection \ ReflectionClass ( Connection :: class ) ; $ this -> selfReflectionNestingLevelProperty = $ reflection -> getProperty ( 'transactionNestingLevel' ) ; $ this -> selfReflectionNestingLevelProperty -> setAccessible ( true ) ; } $ this -> selfReflectionNestingLevelProperty -> setValue ( $ this , 0 ) ; }
This is required because beginTransaction increment _transactionNestingLevel
before the real query is executed, and results incremented also on gone away error.
This should be safe for a new established connection.
This is required because beginTransaction increment _transactionNestingLevel before the real query is executed and results incremented also on gone away error . This should be safe for a new established connection .