If the value is a pipeline, save it as the connection to use for pipelines if to be shared
        in threads or goot thread. Do not remove the direct connection.
        If it is not a pipeline, clear it, and set the direct connection again.

def _connection(self, value):
        """
        If the value is a pipeline, save it as the connection to use for pipelines if to be shared
        in threads or goot thread. Do not remove the direct connection.
        If it is not a pipeline, clear it, and set the direct connection again.
        """
        if isinstance(value, _Pipeline):
            self._pipelined_connection = value
        else:
            self._direct_connection = value
            self._pipelined_connection = None