original_string: protected function reconnect()
      {
          if ($this->connection->inTransaction()) {
              // It is not safe to blindly reconnect in the middle of a transaction
              return false;
          }
  
          try {
              // Make sure we free any resources associated with the old connection
              $this->connection->disconnect();
          } catch (Exception $e) {
          }
  
          try {
              $this->connection->connect();
              $this->connection->log('[RECONNECT]');
  
              return true;
          } catch (Exception $e) {
              // If there was an error connecting again, don't report it back,
              // let the retry handler do it.
              return false;
          }
      }
code: protected function reconnect()
      {
          if ($this->connection->inTransaction()) {
              // It is not safe to blindly reconnect in the middle of a transaction
              return false;
          }
  
          try {
              // Make sure we free any resources associated with the old connection
              $this->connection->disconnect();
          } catch (Exception $e) {
          }
  
          try {
              $this->connection->connect();
              $this->connection->log('[RECONNECT]');
  
              return true;
          } catch (Exception $e) {
              // If there was an error connecting again, don't report it back,
              // let the retry handler do it.
              return false;
          }
      }
code_tokens: protected function reconnect ( ) { if ( $ this -> connection -> inTransaction ( ) ) { // It is not safe to blindly reconnect in the middle of a transaction return false ; } try { // Make sure we free any resources associated with the old connection $ this -> connection -> disconnect ( ) ; } catch ( Exception $ e ) { } try { $ this -> connection -> connect ( ) ; $ this -> connection -> log ( '[RECONNECT]' ) ; return true ; } catch ( Exception $ e ) { // If there was an error connecting again, don't report it back, // let the retry handler do it. return false ; } }
docstring: Tries to re-establish the connection to the server, if it is safe to do so
  
  @return bool Whether or not the connection was re-established
docstring_tokens: Tries to re - establish the connection to the server if it is safe to do so