def validate_relation(self, id_attribute_value, relation_name, entity_manager = None):
    """
    Validates a relation of the current entity, checking if was already
    associated with the entity in a previous transaction context.
    This is security validation method and must be used with previous
    knowledge of its capabilities.

    :type id_attribute_value: Object
    :param id_attribute_value: The value of the id of the relation attribute
    to be validated for previous association.
    :type relation_name: String
    :param relation_name: The name of the relation to be validated for
    previous association.
    :type entity_manager: EntityManager
    :param entity_manager: The optional entity manager
    reference to be used.
    """

    # retrieves the entity manager to be used or the
    # default "embedded" entity manager
    entity_manager = entity_manager or self._entity_manager

    # runs the validation of the relation in the entity manager
    # this implies access to the data source (expensive)
    relation_valid = entity_manager.validate_relation(self, relation_name)

    # returns the result of the relation validation
    return relation_valid