mlflow/database/__init__.py
def _get_managed_session_maker(SessionMaker):
    """
    Creates a factory for producing exception-safe SQLAlchemy sessions that are made available
    using a context manager. Any session produced by this factory is automatically committed
    if no exceptions are encountered within its associated context. If an exception is
    encountered, the session is rolled back. Finally, any session produced by this factory is
    automatically closed when the session's associated context is exited.
    """

    @contextmanager
    def make_managed_session():
        """Provide a transactional scope around a series of operations."""
        session = SessionMaker()
        try:
            yield session
            session.commit()
        except MlflowException:
            session.rollback()
            raise
        except Exception as e:
            session.rollback()
            raise MlflowException(message=e, error_code=INTERNAL_ERROR)
        finally:
            session.close()

    return make_managed_session

    Creates a factory for producing exception-safe SQLAlchemy sessions that are made available
    using a context manager. Any session produced by this factory is automatically committed
    if no exceptions are encountered within its associated context. If an exception is
    encountered, the session is rolled back. Finally, any session produced by this factory is
    automatically closed when the session's associated context is exited.
    
Creates a factory for producing exception-safe SQLAlchemy sessions that are made available
using a context manager. Any session produced by this factory is automatically committed
if no exceptions are encountered within its associated context. If an exception is
encountered, the session is rolled back. Finally, any session produced by this factory is
automatically closed when the session's associated context is exited.
Creates a factory for producing exception - safe SQLAlchemy sessions that are made available using a context manager . Any session produced by this factory is automatically committed if no exceptions are encountered within its associated context . If an exception is encountered the session is rolled back . Finally any session produced by this factory is automatically closed when the session ' s associated context is exited .
def _get_managed_session_maker(SessionMaker):
    @contextmanager
    def make_managed_session():
        session = SessionMaker()
        try:
            yield session
            session.commit()
        except MlflowException:
            session.rollback()
            raise
        except Exception as e:
            session.rollback()
            raise MlflowException(message=e, error_code=INTERNAL_ERROR)
        finally:
            session.close()
    return make_managed_session
def _get_managed_session_maker ( SessionMaker ) : @ contextmanager def make_managed_session ( ) : """Provide a transactional scope around a series of operations.""" session = SessionMaker ( ) try : yield session session . commit ( ) except MlflowException : session . rollback ( ) raise except Exception as e : session . rollback ( ) raise MlflowException ( message = e , error_code = INTERNAL_ERROR ) finally : session . close ( ) return make_managed_session
Creates a factory for producing exception-safe SQLAlchemy sessions that are made available
using a context manager.
Creates a factory for producing exception - safe SQLAlchemy sessions that are made available using a context manager .
"""
    Creates a factory for producing exception-safe SQLAlchemy sessions that are made available
    using a context manager. Any session produced by this factory is automatically committed
    if no exceptions are encountered within its associated context. If an exception is
    encountered, the session is rolled back. Finally, any session produced by this factory is
    automatically closed when the session's associated context is exited.
    """ """Provide a transactional scope around a series of operations."""
SessionMaker