persistence

The best way to store class instances to a file/database

What is the best way to store instances of a class to file/database? We have a base class called Command and loads of derived classes. Users create instances of these classes by adding commands to a graphical designer where they can configure them. (Set the properties). We then need a way to store these "commands" to a file without los...

What is the best practice for persistence right now ?

I come from a java background. But I would like a cross-platform perspective on what is considered best practice for persisting objects. The way I see it, there are 3 camps: ORM camp direct query camp e.g. JDBC/DAO, iBatis LINQ camp Do people still handcode queries (bypassing ORM) ? Why, considering the options available via JPA, D...

Spring, Hibernate & JPA: Calling persist on entitymanager does not seem to commit to database

I'm trying to setup Spring using Hibernate and JPA, but when trying to persist an object, nothing seems to be added to the database. Am using the following: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="url" value="${jdbc.url}"/> <property name="driverClassName" value="${jdbc.driverClass...

Can Spring Webflow 2.0's entity manager commit from subflow states?

Hello. My team and I are currently starting up a project using Spring 2.5.6 and Spring Webflow 2.0 (JDK 1.4.2). We're in the design phase right now, and I would like to know whether or not Spring's Persistence context/entity manager (we're going to use Hibernate) can commit from subflows. The commit attribute is only available from th...

JPA cascade options at runtime

I'm trying to make an application that keeps an object model in sync with a database by observing all changes and then immediately persisting the objects in questions. Many of the object in the model have children in large lists or trees. When I load an object from the database, I rely on a one-way cascading relationship to also retrie...

Delphi object persistence, what is the best way

I have developed application for drawing some shapes (lines mostly) , now i need to be able to store sketch to a file, i know that delphi has build in routines for object persistance, but i have never used it. Can someone tell me can object persistence be used if i have to persist object that have also references to other objects (th...

How to store a dictionary on a Django Model?

I need to store some data on a Django model. These data are not equal to all instances of the model. At first I thought on subclassing the model, but I'm trying to keep the application flexible; if I use subclasses, I'll need to create a whole class each time i need a new kind of object, and that's no good. I'll also end up with a lot o...

Preferred method for persisting databound WPF ObservableCollection?

Hi all, I have a class that inherits from ObservableCollection(Of MyObject) and the MyObject class handles INotifyPropertyChanged as it should. When the user updates this data through bound controls the collection will change as expected. I have a 'Save' button on the form which is meant to persist this collection to disk as XML by cal...

How do I read back in the output of Data::Dumper?

Let's say I have a text file created using Data::Dumper, along the lines of: my $x = [ { foo => 'bar', asdf => undef }, 0, -4, [ [] ] ]; I'd like to read that file back in and get $x back. I tried this: my $vars; { undef $/; $vars = <FILE>; } eval $vars; But it didn't seem to work -- $x not only isn't defined, when I try to us...

Ideas on this alternative to ORM + RDBMS?

I am currently developing a proof of concept for an alternative data store. The reason why is I need to enhance a read-mostly clustered webapp, but also because I want to free myself from the pain of the sometimes overly-complex ORM+RDBMS solution. Overall the idea is quite similar to a distributed cache with persistence (letting the cl...

How do I store program variables in an iPhone application that will survive a program exit?

I need to keep program variable values in an iPhone application when the application is exited. Does the SDK give the programmer any non volitile memory to use? How much is available? Will it be kept thru a power cycle? Through sleep mode? Through a hard reset? ...

Are there any Java VMs which can save their state to a file and then reload that state?

Are there any Java VMs which can save their state to a file and then reload that state? If so, which ones? ...

How do you save variable state in Flash

I'm completely new to Actionscript and I'm trying to figure out if it's possible to save variable state in Flash. I figure I could use XML but is there a way to store it in the Flash file itself? Thank you! ...

Easy way to store and retrieve objects in Java without using a relational DB?

Do you know of an "easy" way to store and retrieve objects in Java without using a relational DB / ORM like Hibernate? [Note that I am not considering serialization as-is for this purpose, as it won't allow to retrieve arbitrary objects in the middle of an object graph. Neither am I considering DB4O because of its restrictive license. T...

Terracotta as data layer

Is it possible to use terracotta for storing data instead of a traditional DBMS? ...

Experiences With Active Objects ORM for Java?

I'm looking at ORMs for Java and Active Objects caught my eye. Apparently, it was inspired by Rails' ActiveRecord. Based on what I've read, this approach seems to solve a lot of problems with existing Java ORMs by embracing convention over configuration. What's been your experience with it? ...

Lightweight Java persistence

What are the lightweight options one has to persist Java objects ? I'm looking for the easiest possible solution. I don't want anything fancy featurewise just something simple that works with reasonnably simple objects (some collections, relationships and simple inheritance) and doesn't bring too much apparent complexity (if any) to th...

Hibernate like layer for C++

Using a DB with C++ is a real mess and it was refreshing when I moved to Java to be able to use a unified system to abstract the whole layer away (aka Hibernate). There are a couple of C++ abstract layers for DB's out there but they are usually vendor specific and only a thin layer that wraps the real C API. Has anybody come across some...

What are synchronizing strategies for Prevayler?

Prevayler guarantees that all the writes ( through its transactions) are synchronized. But what about reads? Is it right that dirty reads are possible if no explicit synchronizing is used (in user code)? Are they possible if a business object is read as: // get the 3rd account Accont account = (Bank)prevayler.prevalentSystem().getAc...

How do i tell if one instance of my program is running?

How do i tell if one instance of my program is running? i thought i could do this with a data file but it would just be messy :( i want to do this as i only want 1 instance to ever be open at one point. Edit: Re-tagged ...