persistence

Enabling ehcache statistics in jboss 4.2.1

I've set hibernate.generate_statistics=true and now need to register the mbeans so I can see the statistics in the jmx console. I can't seem to get anywhere and this doesn't seem like it should be such a difficult problem. Maybe I'm making things overcomplicated, but in any case so far I've tried: I copied EhCacheProvider and had it in...

How to persist an enum using NHibernate

Hi, Is there a way to persist an enum to the DB using NHibernate? That is have a table of both the code and the name of each value in the enum. I want to keep the enum without an entity, but still have a foreign key (the int representation of the enum) from all other referencing entities to the enum's table. ...

Problem using LINQ to SQL with one DataContext per atomic action

I have started using Linq to SQL in a (bit DDD like) system which looks (overly simplified) like this: public class SomeEntity // Imagine this is a fully mapped linq2sql class. { public Guid SomeEntityId { get; set; } public AnotherEntity Relation { get; set; } } public class AnotherEntity // Imagine this is a fully mapped linq2sql c...

NHibernate architecture?

I'm planning to implement my next project (asp.net MVC) by using nhibernate as an ORM. Since I do not have experience with nhibernate, I wondering how I should organize dependencies between different projects. I've seen something like this as a recommended approach: UI depends on Model, Repositories and NHibernate Repositories depend o...

.Net Data Handling Suggestions

I am just beginning to write an application. Part of what it needs to do is to run queries on a database of nutritional information. What I have is the USDA's SR21 Datasets in the form of flat delimited ASCII files. What I need is advice. I am looking for the best way to import this data into the app and have it easily and quickly query...

WCF data persistence between sessions

We are developing a WCF based system. In the process we are trying to lock some data from being modified by more than one users. So we decided to have a data structure that will contain the necessary information for the locking logic to execute (by for example storing the ID of the locked objects) The problem we are having is persisting...

ASP.NET How to best create a test DB when doing TDD?

Hi folks, what's the best practice for creating test persistence layers when doing an ASP.NET site (eg. ASP.NET MVC site)? Many examples I've seen use Moq (or another mocking framework) in the unit test project, but I want to, like .. moq out my persistence layer so that my website shows data and stuff, but it's not coming from a datab...

Function persistence in Common Lisp

Is there any persistence solution for Common Lisp, such as Elephant, that allows function persistence? Currently my app stores an identifier on the db and later searches in a function table which it is, but this method does not allow dynamically created functions to be stored. ...

Is transactional behaviour ever needed outside of databases?

I wouldn't dare do anything complex in a database without transactions. There is nearly always a simple to use in-built command. But when you start working with other persistent data you just don't get this simple to use transaction support. Some example are file systems web services (none that I've used) Even in non-persistent data ...

What is the relationship between IRimTable and PersistenceStore?

The BlackBerry Desktop API has the interface IRimTable which apparently maps an "application database" on a BlackBerry device to a virtual structure (i.e, IRimTable has IRimRecords, each of which has IRimField) that developer can browse the handheld device data when it is connected to a desktop computer. Meanwhile, applications in the ...

How, where to store objects within different scopes in Asp.net 2.0

Hi guys, need ask you about some help. I have web app running in Net 2.0. I wanna ask what storage (cache, session, file) I should use for my objects as they have different scope of using. Can be divide into several groups: 1) objects related directly to visitor (e.g. details about visitor that are received after authentication) 2) o...

ejb3-persistence.jar source

Well, I must be brain-damaged, because I can't find the java source for Sun's persistence.jar or JBoss's ejb3-persistence.jar JPA package. They are open-source aren't they? I looked all over the java.sun.com site as well as the GlassFish wiki, but came up empty. I'd like a src.zip or folder like Sun delivers with Java JDKs. Of course...

java.lang.UnsupportedOperationException in JPA transaction

I'm pretty sure that I'm not understanding something about JPA (I'm using OpenJPA) and it's causing this problem. I want to make a copy of a Job entity. @Entity @Table(name="Job") public class Job implements Serializable { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private int id; @ManyToOne private Job ...

JPA/Hibernate mapping to store months and days-of-months

I have following POJOs: class Month { long id; String description; List<Day> days; // always contains 29, 30 or 31 elements } class Day { byte nr; // possible values are 1-31 String info; } Is there a way to store these objects into following DB structure using JPA+Hibernate: Table MONTHS: id;description; Table...

Is query to new added object possible in MS Entity Framework

Is there a way to query or just access newly added object (using ObjectContext.AddObject method) in Entity Framework? I mean situation when it is not yet saved to data store using SaveChanges I understand that queries are translated to underlying SQL and executed against data store, and it don't have this new object yet. But anyway, I'm...

How would one make Python objects persistent in a web-app?

I'm writing a reasonably complex web application. The Python backend runs an algorithm whose state depends on data stored in several interrelated database tables which does not change often, plus user specific data which does change often. The algorithm's per-user state undergoes many small changes as a user works with the application. T...

What is really stored in Session in ASP.NET?

We are trying to decide how to handle object persistence accross postbacks, to avoid getting the data from the database in every request, and I'm leaning towards using Session (it's an intranet application, there won't be thousands of users), but this is due to the fact that I suspect that only the reference to the real object is stored ...

What are your favorite books about data persistance, persistence patterns and/or techniques?

What are your favorite book(s) about data persistence, persistence patterns and/or techniques? Which book(s) advanced your knowledge in this area the most. Open to all languages/platforms. ...

Which .NET frameworks allow you to create Business Entities first, then Database

Do any .NET frameworks allow you to create Business Entities first then Database. In other words allow you to use DDD / Persistence Ignorance method of backing into the database later. Any tools that allow the Models/Classes you have written to generate the SQL DDL and migration scripts. Feel free to rework my verbiage, and make it a be...

On using Terracotta as a persistence solution.

Would it be a good idea to use Terracotta as a persistence solution (replacing a database)? I'm specifically wondering about data integrity issues and support for transactional systems. ...