Reloads the attributes of this object from the database.
 The optional options argument is passed to find when reloading so you
 may do e.g. record.reload(:lock => true) to reload the same record with
 an exclusive row lock.
497182
def reload(options = nil)
      clear_aggregation_cache
      clear_association_cache

      IdentityMap.without do
        fresh_object = self.class.unscoped { self.class.find(self.id, options) }
        @attributes.update(fresh_object.instance_variable_get('@attributes'))
      end

      @attributes_cache = {}
      self
    end
437524
def update(instance, full_clean=True, post_save=False, **kwargs):
    ""

    # apply the updated args to the instance to mimic the change
    # note that these might slightly differ from the true database values
    # as the DB could have been updated by another thread. callers should
    # retrieve a new copy of the object if up-to-date values are required
    for k, v in kwargs.iteritems():
        if isinstance(v, ExpressionNode):
            v = resolve_expression_node(instance, v)
        setattr(instance, k, v)

    # clean instance before update
    if full_clean:
        instance.full_clean()

    # fields that use auto_now=True should be updated corrected, too!
    for field in instance._meta.fields:
        if hasattr(field, 'auto_now') and field.auto_now and field.name not in kwargs:
            kwargs[field.name] = field.pre_save(instance, False)

    rows_affected = instance.__class__._default_manager.filter(
        pk=instance.pk).update(**kwargs)

    if post_save:
        signals.post_save.send(sender=instance.__class__, instance=instance)

    return rows_affected
442818
def reload_solver(self, constraints=None):
        

        if constraints is None:
            constraints = self._solver.constraints
        self._stored_solver = None
        self._solver.add(constraints)
878220
def coerced_attributes
      attrs = []

      if new_record?
        attributes.each do |k, v|
          attrs << k << coerce_for_persistence(v) if (self.class.attributes[k][:default] || nil) != v
        end
      else
        changed_attributes.each_key do |key|
          attrs << key << coerce_for_persistence(attributes[key])
        end
      end

      attrs
    end
368056
function reload(req, res) {
  var log = this.log;
  if(Persistence.loading) {
    return res.send(new Error('database load in progress'));
  }
  Persistence.load(this.state.store, this.state.conf,
    function onLoad(err, time, diff, version) {
      if(err) return log.warning('db reload error: %s', err.message);
      log.notice(
        'db reloaded by DEBUG RELOAD: %s seconds (v%s)', time, version);
    }
  );
  res.send(null, Constants.OK);
}
1060566
def save(self, *args, **kwargs):
        
        cls = self.__class__
        if self.pk:
            rows = cls.objects.filter(
                pk=self.pk, _change=self._change).update(
                _change=self._change + 1)
            if not rows:
                raise ConcurrentModificationError(cls.__name__, self.pk)
            self._change += 1

        count = 0
        max_retries=3
        while True:
            try:
                return super(BaseModel, self).save(*args, **kwargs)
            except django.db.utils.OperationalError:
                if count >= max_retries:
                    raise
                count += 1
690206
def reload
      object = self.id.present? ? 
                 persistence_class.where(id: self.id).first_or_initialize : 
                 self

      serialize! object.attributes
    end
1050614
def _reload(self, object, description, data):
        ''''''
        self._object = object
        self._description = description
        self._data = data
1160866
def load(self, callback=None, errback=None, reload=False):
        
        if not reload and self.data:
            raise RecordException('record already loaded')

        def success(result, *args):
            self._parseModel(result)
            if callback:
                return callback(self)
            else:
                return self
        return self._rest.retrieve(self.parentZone.zone,
                                   self.domain, self.type,
                                   callback=success, errback=errback)
962015
def load_into_database(options={})
      # necessary to make multiple invocations possible in a single test
      # case possible
      ActiveRecord::Fixtures.reset_cache

      # Filter down the models to load if specified
      the_tables = if options.has_key?(:only)
        self.table_names.select {|x| Array(options[:only]).map(&:to_s).include?(x) }
      elsif options.has_key?(:except)
        self.table_names.select {|x| !Array(options[:except]).map(&:to_s).include?(x) }
      else
        self.table_names
      end
      raise "No models to load, relax your :only or :except filters (or don't bother calling this method)" if the_tables.empty?


      #This wraps all the inserts into a single transaction allowing the constraint check to happen at the end.
      ActiveRecord::Base.transaction do

        the_tables.each do |table_name|
          class_name = if self.table_name_to_model_name_hash.kind_of?(Hash)
            self.table_name_to_model_name_hash[table_name]
          else
            ActiveSupport::Deprecation.warn "your fe_manifest.yml does not contain a table_name_to_model_name_hash (as found in 1.0.0 or earlier). Version 2.0.0 will require this. See test cases for how to manually jigger your fe_manifest.ymls to function."
            nil
          end
          if options[:map].nil?
            # Vanilla create_fixtures will work fine when no mapping is being used
            ActiveRecord::Fixtures.create_fixtures(self.target_path, table_name)
          else
            # Map table_name via a function (great for prefixing)
            new_table_name = if options[:map].kind_of?(Proc)
              options[:map].call(table_name)
            # Map table_name via a Hash table name mapping
            elsif options[:map][table_name].kind_of? String
              options[:map][table_name]
            else
              table_name # No mapping for this table name
            end
            fixtures = ActiveRecord::Fixtures.new( ActiveRecord::Base.connection,
                new_table_name,
                class_name,
                ::File.join(self.target_path, table_name))
            fixtures.table_rows.each do |the_table_name,rows|
              rows.each do |row|
                ActiveRecord::Base.connection.insert_fixture(row, the_table_name)
              end
            end
          end
          # FIXME: The right way to do this is to fork the oracle enhanced adapter
          # and implement a reset_pk_sequence! method, this is what ActiveRecord::Fixtures
          # calls.  aka this code should be eliminated/live elsewhere.
          case ActiveRecord::Base.connection.adapter_name
          when /oracle/i
            model = class_name.constantize
            if model.column_names.include? "id"
              sequence_name = model.sequence_name.to_s
              max_id = model.maximum(:id)
              next_id = max_id.nil? ? 1 : max_id.to_i + 1
              begin
                ActiveRecord::Base.connection.execute("drop sequence #{sequence_name}")
              rescue
                puts "[Iron Fixture Extractor] WARNING: couldnt drop the sequence #{sequence_name}, (but who cares!)"
              end
              begin
                q="create sequence #{sequence_name} increment by 1 start with #{next_id}"
                ActiveRecord::Base.connection.execute(q)
              rescue
                puts "[Iron Fixture Extractor] WARNING: couldnt create the sequence #{sequence_name}"
              end
            end
          else
            # Do nothing, only oracle adapters need this
          end
        end
      end # End transaction
    end
562854
def reload
      answer = connection.protocol::DbReload.new(params).process(connection)
      @clusters = answer[:clusters]
      self
    end
252795
def reload(self) -> None:
        """"""
        if not self.state_.is_persisted or self.state_.is_changed:
            raise InvalidStateError(f'`{self.__class__.__name__}` object is in invalid state')

        # Retrieve the entity's ID by the configured Identifier field
        identifier = getattr(self, self.meta_.id_field.field_name)
        logger.debug(f'Lookup `{self.__class__.__name__}` object with '
                     f'identifier {self.meta_.id_field}')

        # Fetch the entity data from db by its identifier
        db_value = self.get(identifier)

        # Update own data from fetched entity data
        # This allows us to ``dog.reload()`` instead of ``dog = dog.reload()``
        self._update_data(db_value.to_dict())
879322
def if_stale?(record, options = {})
      if stale?(StaleOptions.create(record, options))
        block_given? ? yield(record) : true
      end
    end
669423
def update(self, _attributes=None, **attributes):
        
        if _attributes is not None:
            attributes.update(_attributes)

        if self._related.uses_timestamps():
            attributes[self.get_related_updated_at()] = self._related.fresh_timestamp()

        return self._query.update(attributes)
1184305
def reload(url = nil, parameters = {})
      httparty = self.class.get(url || self[:@url], StorageRoom.request_options.merge(parameters))
      hash = httparty.parsed_response.first[1]
      reset!
      set_from_response_data(hash)
      true
    end
199841
def reload(self, d=None):
        """"""
        if d:
            self.clear()
            self.update(d)
        elif self.id:
            new_dict = self.by_id(self._id)
            self.clear()
            self.update(new_dict)
        else:
            # should I raise an exception here?
            # Like "Model must be saved first."
            pass
704511
def reload(core = false, loaded = [], &code)
    Manager.connection.reload(core, loaded, &code)
  end