object-persistence

Classic ASP Store objects in the session object

南笙酒味 提交于 2019-12-17 19:47:12
问题 I am new to classic ASP and I need to code a web application in classic asp because the customer wants it to be in classic asp. :( Anyways! here is my question: When I have a object of a class called person: Class Person Private m_sFirstName Public Property Get firstName firstName = m_sFirstName End Property Public Property Let firstName(value) m_sFirstName = value End Property End Class set aPerson = new Person Person.firstName = "Danny" set Session("somePerson") = aPerson So far so good...

What's the easiest way to persist java objects?

五迷三道 提交于 2019-12-17 18:47:11
问题 Right now I have java program whose classes are currently POJOs and stored in volatile memory. These need to be persisted. As I understand it two popular choices are JDO and the Java Persistence API. For someone who know little about SQL, Torque, etc, which is the easiest way to add persistence to my program's data? 回答1: The traditional way to serialise to the filesystem is to use Java Serialisation. However you need to implement Serializable everywhere. A simpler solution is to serialise to

Do I ever need to explicitly flush GORM save calls in grails?

筅森魡賤 提交于 2019-12-17 15:23:15
问题 I have a strange situation which appears to indicate a GORM cacheing problem //begin with all book.status's as UNREAD Book.list().each { book.status = Status.READ ; book.save() } println (Book.findAllByStatus (Status.READ)) //will print an empty list println (Book.list().findAll (it.status == Status.READ)) // will print all books I cannot understand why the last two queries could return different results. However if I make the following modification of book.save(flush:true) . Both of the

Persistent Objects in Wordpress/PHP

别说谁变了你拦得住时间么 提交于 2019-12-12 05:39:29
问题 I would like to create a set of persistent objects that load their state from the database and are then persisted in memory for Wordpress/PHP page loads to use as cached memory objects. I would imagine an interface for these objects to include: initialise() - load state from database and perform any other initialisation functions needed prior to servicing requests getter_foo() - a series of getter methods for PHP code to call for memory cached responses getter_bar() - a series of getter

C++ object persistence library similar to eternity

拈花ヽ惹草 提交于 2019-12-10 20:16:51
问题 I'm looking for a C++ object persistence library to replace the Eternity library that I've been prototyping with for about a day. The Eternity library came up short. I've created an object hierarchy similar to this: I have an std::list of ArchiveJob* 's that I'd like to persist and restore in XML format. Each ArchiveJob has various child objects, some allocated on the stack, some on the heap. Eternity did a good job of persisting these objects correctly, but it failed when restoring them.

Lambdas, closed-over variables, display classes, serializability, and prevalence layers

a 夏天 提交于 2019-12-10 11:19:53
问题 I've implemented a prevalence layer for Compact Framework (including a BinaryFormatter -like serializer). I'd like to be able to serialize the compiler-generated classes that result from such things as lambdas and iterators where appropriate, so that if (for example) a lambda and its closed-over variables (that is, the display class instance) is added to an event on a serializable object, and all the closed-over variables are serializable, then the resulting object graph is still fully

android application/activity life cycle: when should we save to flash?

时间秒杀一切 提交于 2019-12-10 10:58:26
问题 I have an app that is composed of many activities. Each activity can modify the project in some way. I'm saving this project to flash by serializing a few objects and saving them to flash. Now, If the user leaves the app, it's possible that it gets killed by the os. Therefore, I should save at every onPause() on every activity.. But this is very stupid and consuming (serialize, open file, overwrite file..).. Do you have any better idea? By the way, if I don't want to use a Database, to save

Javascript: persist window object reference?

雨燕双飞 提交于 2019-12-10 10:24:22
问题 My javascript code open some windows trough: var win = window.open(); I store the win refernce in an array with all the other opened windows. Everything works fine, until the opener is refreshed. So what i'd like to achive is to get back all the references to the opened windows when the "master" window is loaded. To realize this i have to: 1. persist all the references on unload 2. get back the references on load 3. update the references with the new opener Is it possible? if so how? 回答1:

android application/activity life cycle: when should we save to flash?

半腔热情 提交于 2019-12-06 09:22:02
I have an app that is composed of many activities. Each activity can modify the project in some way. I'm saving this project to flash by serializing a few objects and saving them to flash. Now, If the user leaves the app, it's possible that it gets killed by the os. Therefore, I should save at every onPause() on every activity.. But this is very stupid and consuming (serialize, open file, overwrite file..).. Do you have any better idea? By the way, if I don't want to use a Database, to save my projects is object serialization good enough or should I use something more robust (xml?) ? Thanks

When are Active Record objects in has_many relationships saved?

牧云@^-^@ 提交于 2019-12-06 04:44:43
问题 I'm using Rails 1.2.3 (yeah, I know) and am confused about how has_many works with respect to object persistence. For the sake of example, I'll use this as my declaration: class User < ActiveRecord::Base has_many :assignments end class Assignment < ActiveRecord::Base belongs_to :user end As I understand it, this generates, among others, a method User#assignments.build , which creates an Assignment object whose user_id is the receiving instance's id (and whose other fields are as specified in