Store the serialized object
@param savePoint the save point
@param obj the object to save
321939
public void store(String savePoint, Object obj)
   {
	if (savePoint == null)
	   throw new RequiredException("savePoint");
	
	if (obj == null)
	   throw new RequiredException("obj");
	
	String location = whereIs(savePoint, obj.getClass());

	Debugger.println(this,"Storing in "+location);
	
	IO.serializeToFile(obj, new File(location));
   }
1206124
public static void serializeToDisk( File file, Object obj ) throws IOException {
        byte[] serializedObj = serialize(obj);
        try (RandomAccessFile raFile = new RandomAccessFile(file, "rw")) {
            raFile.write(serializedObj);
        }
    }
1134906
def save_object(self, obj):
        
        self.session.add(obj)
        self.session.flush()
        return obj
511288
public function createSavepoint($savepoint)
    {
        if (! $this->getDatabasePlatform()->supportsSavepoints()) {
            throw ConnectionException::savepointsNotSupported();
        }

        $this->getWrappedConnection()->exec($this->platform->createSavePoint($savepoint));
    }
987600
public static String serialize(final Object obj) throws IOException {
		final ObjectMapper mapper = new ObjectMapper();
        mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
		return mapper.writeValueAsString(obj);
		
	}
7307
def save(self, obj):
        """"""
        cur = self._conn().cursor()

        tabname = obj.__class__.get_table_name()

        index_names = obj.__class__.index_names() or []

        col_names = ['id', 'value'] + index_names
        value_holders = ['%s'] * len(col_names)
        updates = ['%s = EXCLUDED.%s' % (cn, cn) for cn in col_names[1:]]

        if not obj.id:
            id = uuid()
            obj.id = id

        query = 'insert into {0} ({1}) values ({2}) on conflict(id) do update set {3};'.format(
            tabname,
            ','.join(col_names),
            ','.join(value_holders),
            ','.join(updates),
        )

        values = [obj.id, obj.to_data()]

        index_vals = obj.indexes() or {}
        values += [index_vals.get(name, 'NULL') for name in index_names]

        with self._conn() as conn:
            with conn.cursor() as cur:
                cur.execute(query, tuple(values))
889276
@Override
	public void setSavepoint(final String savepointName) {
		Optional<LocalTransactionContext> txContext = currentTxContext();
		if (txContext.isPresent()) {
			txContext.get().setSavepoint(savepointName);
		} else {
			this.unmanagedTransaction.ifPresent(ut -> ut.setSavepoint(savepointName));
		}
	}
679719
public static void recordInstance(Object obj) {
		// obj will be a ClassPropertyFetcher instance
		System.err.println("new instance queued " + System.identityHashCode(obj));
		// TODO urgent - race condition here, can create Co-modification problem if adding whilst another thread is processing
		classPropertyFetcherInstances.add(new WeakReference<Object>(obj, rq));
	}
683180
def save(self, obj):
        """"""
        if not obj.id:
            obj.id = uuid()

        index_names = obj.__class__.index_names() or []
        index_dict = obj.indexes() or {}
        index_name_values = [
            (key, index_dict.get(key, ''))
            for key in index_names
        ]

        write_rec(
            obj.__class__.get_table_name(),
            obj.id,
            obj.to_data(),
            index_name_values
        )
21587
public static void saveAll(final Object obj, final PersistenceStoreType storeType) {

        try {

            File file = new File(persistenceStorePath + File.separator + storeType);

            // create necessary parent directories on file system
            File directory = file.getParentFile();
            if (null != directory && !directory.exists()) {
                directory.mkdirs();
            }

            log.info("aws-mock: saving to {}", file.getAbsolutePath());

            ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file, false));
            out.writeObject(obj);
            out.close();
        } catch (FileNotFoundException e) {
            log.error("FileNotFoundException caught during saving object to file: {}",
                    e.getMessage());
        } catch (IOException e) {
            log.error("IOException caught during saving object to file: {}", e.getMessage());
        }

    }
1207592
public void save(String saveModelFile) throws IOException {
		System.out.println("save ...");
		ObjectOutputStream out = new ObjectOutputStream(
				new BufferedOutputStream(new GZIPOutputStream(
						new FileOutputStream(saveModelFile))));
		out.writeObject(new Integer(n));
		out.close();
		System.out.println("OK");
	}
514436
def save(self, obj, id_code):
        
        filestream = open('{0}/{1}'.format(self.data_path, id_code), 'w+')
        pickle.dump(obj, filestream)
        filestream.close()
1165815
def save_codeobject(self, obj):
        
        if self.dump_code:
            print(obj.co_name)
            dis.dis(obj.co_code)
        self.save_reduce(types.CodeType, self._extract_code_args(obj), obj=obj)
183564
public void update(Object object) {
        try {
            persistenceManager.saveEntity((IManagedEntity) object);
        } catch (InitializationException ignore){}
        catch (Exception e) {
            e.printStackTrace();
        }
    }
681679
def save_inst(self, obj):
        """"""
        cls = obj.__class__

        # Try the dispatch table (pickle module doesn't do it)
        f = self.dispatch.get(cls)
        if f:
            f(self, obj)  # Call unbound method with explicit self
            return

        memo = self.memo
        write = self.write
        save = self.save

        if hasattr(obj, '__getinitargs__'):
            args = obj.__getinitargs__()
            len(args)  # XXX Assert it's a sequence
            pickle._keep_alive(args, memo)
        else:
            args = ()

        write(pickle.MARK)

        if self.bin:
            save(cls)
            for arg in args:
                save(arg)
            write(pickle.OBJ)
        else:
            for arg in args:
                save(arg)
            write(pickle.INST + cls.__module__ + '\n' + cls.__name__ + '\n')

        self.memoize(obj)

        try:
            getstate = obj.__getstate__
        except AttributeError:
            stuff = obj.__dict__
        else:
            stuff = getstate()
            pickle._keep_alive(stuff, memo)
        save(stuff)
        write(pickle.BUILD)
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());
    }
339743
public Object storeObject(Object object)
    {
        PersistenceBroker broker = getBroker();
        try
        {
            broker.store(object);
        }
        finally
        {
            if (broker != null) broker.close();
        }
        return object;
    }