object-persistence

Javascript: persist window object reference?

老子叫甜甜 提交于 2019-12-06 00:26:32
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? This sounds very complicated (read: problematic). What you're asking has been an issue since way back and goes

JPA and unique fields

社会主义新天地 提交于 2019-12-04 16:39:21
I have two persistence objects in my app: Things and tags attached to things. The app can generate collections of things with tags attached. Tag objects have a unique name (it doesn't make sense to tag something twice with the same tag). When inserting a Thing (with tag objects attached) some of these tag objects with the same name maybe already exist in the db. Now here is the part I don't recall about JPA, is there a way to tell JPA that it should not try to add the corresponding objects to the db if it violates the unique constraint? Or is there a way to do this efficiently w/o having to

When are Active Record objects in has_many relationships saved?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 14:51:22
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 the argument), but does not save this object in the database. The object can be saved later by calling

Using Persistent Store in BlackBerry

烈酒焚心 提交于 2019-12-04 07:08:20
问题 I am developing a BlackBerry application. I want to store the details of multiple users in my mobile. I have to store data like username, first name, last name ,email id ,phone number for each user. Can any one please provide me a sample code for persistent store using which I can store all this data in a vector and retrieve later. 回答1: This link should answer most of what you need to know - http://www.miamicoder.com/post/2010/04/13/How-to-Save-BlackBerry-Application-Settings-in-the

Ruby daemon process to keep objects alive for transient Ruby instances

房东的猫 提交于 2019-12-04 02:39:01
问题 Does Ruby offer a mechanism to share variables (more importantly, class objects and any other data abstractions I deem useful for that matter) between different running Ruby processes? For example if I have a class instantiated, initialized and carefully tuned to a certain state, I want that state to sort of globally be available to all my otherwise independent Ruby and Irb runs throughout the day, outliving the lifetime of the process that initially used it. One scenario I'm now considering

What does a EClassNotFound raised at runtime really mean when the class in question is there at compile and link time, and there explicitly in code?

风流意气都作罢 提交于 2019-12-03 20:01:33
问题 I have a runtime error happening in the rtl Streaming in of a form, causing an exception EClassNotFound to be raised, while doing TReader.ReadRootComponent. The particular error message is "Class not found TActionList". What is odd is: My main form uses Action list. For fun, I added ActnList.pas (from the VCL source folder) to my project, to try to fix it. This happens to me when instantiating a form that I had working until a few minutes ago. The change that I made was in some sub-frame code

Using Persistent Store in BlackBerry

∥☆過路亽.° 提交于 2019-12-02 12:19:56
I am developing a BlackBerry application. I want to store the details of multiple users in my mobile. I have to store data like username, first name, last name ,email id ,phone number for each user. Can any one please provide me a sample code for persistent store using which I can store all this data in a vector and retrieve later. This link should answer most of what you need to know - http://www.miamicoder.com/post/2010/04/13/How-to-Save-BlackBerry-Application-Settings-in-the-Persistent-Store.aspx . Below is some code from one of my projects. public class PreferencesStore { // Not a real key

Persistence with embedded forms

余生颓废 提交于 2019-12-01 18:49:37
I am trying to set up some embedded forms using this guide. I have two models set up in my application, Lesson and Evaluation. Each Lesson can have multiple Evaluations. I have a form set up where the user can create a lesson and also as many evaluations as they want within that lesson. When the form is submitted, it creates the lesson record and all of the evaluation records successfully, however the evaluation records that get created are not linked to the parent lesson (the lesson_id field is just left blank). Can anyone help? Any advice appreciated. Thanks. My Model classes are set up like

Persistence with embedded forms

冷暖自知 提交于 2019-12-01 18:10:11
问题 I am trying to set up some embedded forms using this guide. I have two models set up in my application, Lesson and Evaluation. Each Lesson can have multiple Evaluations. I have a form set up where the user can create a lesson and also as many evaluations as they want within that lesson. When the form is submitted, it creates the lesson record and all of the evaluation records successfully, however the evaluation records that get created are not linked to the parent lesson (the lesson_id field

Ruby daemon process to keep objects alive for transient Ruby instances

白昼怎懂夜的黑 提交于 2019-12-01 14:37:24
Does Ruby offer a mechanism to share variables (more importantly, class objects and any other data abstractions I deem useful for that matter) between different running Ruby processes? For example if I have a class instantiated, initialized and carefully tuned to a certain state, I want that state to sort of globally be available to all my otherwise independent Ruby and Irb runs throughout the day, outliving the lifetime of the process that initially used it. One scenario I'm now considering to effectively address this problem is to create a micro Ruby script acting merely as a keeper of my