@staticmethod
def handle_session(session, exc=None):
    """
        Handles closing a session.

        :param Session session: The session to close.
        :param Exception exc: The exception raised,
            If an exception was raised, else None
        """
    if exc:
        session.rollback()
    session.close()
