@transactional_session
def set_tombstone(rse_id, scope, name, tombstone=OBSOLETE, session=None):
    '\n    Sets a tombstone on a replica.\n\n    :param rse_id: ID of RSE.\n    :param scope: scope of the replica DID.\n    :param name: name of the replica DID.\n    :param tombstone: the tombstone to set. Default is OBSOLETE\n    :param session: database session in use.\n    '
    rowcount = session.query(models.RSEFileAssociation).filter(and_((models.RSEFileAssociation.rse_id == rse_id), (models.RSEFileAssociation.name == name), (models.RSEFileAssociation.scope == scope), (~ exists().where(and_((models.ReplicaLock.rse_id == rse_id), (models.ReplicaLock.name == name), (models.ReplicaLock.scope == scope)))))).with_hint(models.RSEFileAssociation, 'index(REPLICAS REPLICAS_PK)', 'oracle').update({models.RSEFileAssociation.tombstone: tombstone}, synchronize_session=False)
    if (rowcount == 0):
        try:
            session.query(models.RSEFileAssociation).filter_by(scope=scope, name=name, rse_id=rse_id).one()
            raise exception.ReplicaIsLocked(('Replica %s:%s on RSE %s is locked.' % (scope, name, get_rse_name(rse_id=rse_id, session=session))))
        except NoResultFound:
            raise exception.ReplicaNotFound(('Replica %s:%s on RSE %s could not be found.' % (scope, name, get_rse_name(rse_id=rse_id, session=session))))
Sets a tombstone on a replica.

:param rse_id: ID of RSE.
:param scope: scope of the replica DID.
:param name: name of the replica DID.
:param tombstone: the tombstone to set. Default is OBSOLETE
:param session: database session in use.
@transactional_session
def set_tombstone(rse_id, scope, name, tombstone=OBSOLETE, session=None):
    '\n    Sets a tombstone on a replica.\n\n    :param rse_id: ID of RSE.\n    :param scope: scope of the replica DID.\n    :param name: name of the replica DID.\n    :param tombstone: the tombstone to set. Default is OBSOLETE\n    :param session: database session in use.\n    '
    rowcount = session.query(models.RSEFileAssociation).filter(and_((models.RSEFileAssociation.rse_id == rse_id), (models.RSEFileAssociation.name == name), (models.RSEFileAssociation.scope == scope), (~ exists().where(and_((models.ReplicaLock.rse_id == rse_id), (models.ReplicaLock.name == name), (models.ReplicaLock.scope == scope)))))).with_hint(models.RSEFileAssociation, 'index(REPLICAS REPLICAS_PK)', 'oracle').update({models.RSEFileAssociation.tombstone: tombstone}, synchronize_session=False)
    if (rowcount == 0):
        try:
            session.query(models.RSEFileAssociation).filter_by(scope=scope, name=name, rse_id=rse_id).one()
            raise exception.ReplicaIsLocked(('Replica %s:%s on RSE %s is locked.' % (scope, name, get_rse_name(rse_id=rse_id, session=session))))
        except NoResultFound:
            raise exception.ReplicaNotFound(('Replica %s:%s on RSE %s could not be found.' % (scope, name, get_rse_name(rse_id=rse_id, session=session))))