code: def transactional(func):
      
      @wraps(func)
      def wrapper(*args, **kwargs):
          with transaction():
              return func(*args, **kwargs)
      return wrapper
docs: Decorate a function call with a commit/rollback and pass the session as the first arg.