==========================================================================
 Persistence
555374
def expire(sec)
      RRRSpec.redis.expire(key, sec)
      RRRSpec.redis.expire(RRRSpec.make_key(key, 'log'), sec)
    end
823313
function PersistInNode(n) {
        RED.nodes.createNode(this,n);
        var node = this;

        node.name = n.name;
        node.storageNode = RED.nodes.getNode(n.storageNode);

        node.on("input", function(msg) {
            node.storageNode.store(node.name, msg);
        });
    }
767274
public void commit ()
        throws PersistenceException
    {
        // only write ourselves out if we've changed
        if (_storedTileSetID == _nextTileSetID) {
            return;
        }

        try {
            BufferedWriter bout = new BufferedWriter(new FileWriter(_mapfile));
            // write out our metadata
            String tline = "" + _nextTileSetID;
            bout.write(tline, 0, tline.length());
            bout.newLine();
            // write out our mappings
            writeMapFile(bout, _map);
            bout.close();

        } catch (IOException ioe) {
            String errmsg = "Failure writing map file.";
            throw new PersistenceException(errmsg, ioe);
        }
    }
540587
public function save()
    {
        $em = Application::getFacadeApplication()->make(EntityManagerInterface::class);
        $em->persist($this);
        $em->flush();
    }
859727
def _make_persistent(self, model_name, pkg_name):
        """"""

        #
        # WARNING: ugly piece of monkey-patching below. Hopefully will replace
        # with native bravado-core code in the future...
        #

        # Load class at path pkg_name
        c = get_function(pkg_name)
        for name in ('load_from_db', 'save_to_db'):
            if not hasattr(c, name):
                raise PyMacaronCoreException("Class %s has no static method '%s'" % (pkg_name, name))

        log.info("Making %s persistent via %s" % (model_name, pkg_name))

        # Replace model generator with one that adds 'save_to_db' to every instance
        model = getattr(self.model, model_name)
        n = self._wrap_bravado_model_generator(model, c.save_to_db, pkg_name)
        setattr(self.model, model_name, n)

        # Add class method load_from_db to model generator
        model = getattr(self.model, model_name)
        setattr(model, 'load_from_db', c.load_from_db)
762335
public void checkpoint(ObjectEnvelope mod)
            throws org.apache.ojb.broker.PersistenceBrokerException
    {
        mod.doUpdate();
    }
204013
protected function persist()
    {
        $this->db->beginTransaction();

        try {
            $user = $this->model->find($this->selectedUser);
            $user->update(['password' => Hash::make($this->password)]);
        } catch (Exception $e) {
            $this->db->rollBack();
            $this->warn('Could not persist to the database: ' . $e->getMessage());
        }

        $this->db->commit();
        $this->info('Password Updated');

    }
234115
def persist(self, context):
		""""""
		
		D = self._Document
		document = context.session[self.name]
		
		D.get_collection().replace_one(D.id == document.id, document, True)
808367
public void persist(Node node)
    {
        Object entity = node.getData();
        Object id = node.getEntityId();
        EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, node.getDataClass());
        isUpdate = node.isUpdate();
        List<RelationHolder> relationHolders = getRelationHolders(node);
        onPersist(metadata, entity, id, relationHolders);
        id = PropertyAccessorHelper.getId(entity, metadata);
        node.setEntityId(id);
        indexNode(node, metadata);
    }
700046
public void savePersistentObject(PersistentObject object) {
        final String type = object.getClass().getSimpleName();
        LOG.trace("Trying to create a new " + type);
        dao.saveOrUpdate(object);
        LOG.info("Created the " + type + " with id " + object.getId());
    }
213305
public static function addPersistence($persistenceId, array $persistenceConf)
    {
        $manager = self::getDefaultManager();
        $configs = $manager->getOption(self::OPTION_PERSISTENCES);
        $configs[$persistenceId] = $persistenceConf;
        $manager->setOption(self::OPTION_PERSISTENCES, $configs);
        
        $manager->getServiceManager()->register(self::SERVICE_ID, $manager);
    }
284485
protected void persistProperties() throws Exception {
		if (isNewState()) {
			return;
		}

		if (Database.DB_TYPE_HSQLDB.equals(model.getDb().getType())) {
			configuration.save(new File(fileName));
		}
		model.getDb().getTableSession().update(getSessionId(), getSessionName());
	}
1270398
@Override
  public void persist(Object obj) {
    if (null == obj) {
      throw new IllegalArgumentException("object to save cannot be null");
    }
    objMapper.saveObj(keyspace, obj);
  }
248810
protected function buildPersistenceConfiguration(array $persistenceConfig)
    {
        $persistence = array();

        if (!array_key_exists(self::PROVIDER, $persistenceConfig)) {
            $persistence[self::PROVIDER] = 'null';
        } else {
            $persistence[self::PROVIDER] = $persistenceConfig[self::PROVIDER];
        }

        if (array_key_exists(self::PARAMS, $persistenceConfig)) {
            if (!is_array($persistenceConfig[self::PARAMS])) {
                $persistenceConfig[self::PARAMS] = $this->toArray($persistenceConfig[self::PARAMS]);
            }

            $persistence[self::PARAMS] = $persistenceConfig[self::PARAMS];

            if (array_key_exists(self::DIR, $persistence[self::PARAMS])) {
                $persistence[self::PARAMS][self::DIR] = $this->getFullPath($persistence[self::PARAMS][self::DIR]);
            }
        }

        return $persistence;
    }
573924
public function persist(PersistableInterface $persistable, $remember = false)
    {
        try
        {
            if ($this->single)
            {
                $this->flush($persistable);
            }

            $code = $persistable->generatePersistenceCode();

            $this->session->put($code);

            if ($remember === true) {
                $this->cookie->put($code);
            }

            $persistence = $this->create($persistable, $code);

            $entityManager = $this->getEntityManager();
            $entityManager->persist($persistence);
            $entityManager->flush();

            return true;
        }
        catch (\Exception $e)
        {
            return false;
        }
    }
134790
public synchronized void persist() throws KeyStoreException, NoSuchAlgorithmException, CertificateException {
		try
		{
			FileOutputStream kso = new FileOutputStream(new File(root, _caPrivateKeystore));
			_ks.store(kso, _keystorepass);
			kso.flush();
			kso.close();
			persistCertMap();
			persistSubjectMap();
			persistKeyPairMap();
			persistPublicKeyMap();
		}
		catch(IOException ioe)
		{
			ioe.printStackTrace();
		}
	}
1041633
void persist(final String key, final String value, final boolean enableDisableMode, final boolean disable, final File file, final String realm) throws IOException, StartException {
        final PropertiesFileLoader propertiesHandler = realm == null ? new PropertiesFileLoader(file.getAbsolutePath(), null) :
                new UserPropertiesFileLoader(file.getAbsolutePath(), null);
        try {
            propertiesHandler.start(null);
            if (realm != null) {
                ((UserPropertiesFileLoader) propertiesHandler).setRealmName(realm);
            }
            Properties prob = propertiesHandler.getProperties();
            if (value != null) {
                prob.setProperty(key, value);
            }
            if (enableDisableMode) {
                prob.setProperty(key + "!disable", String.valueOf(disable));
            }
            propertiesHandler.persistProperties();
        } finally {
            propertiesHandler.stop(null);
        }
    }