Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Looking for a simple in memory ORM solution

  Asked By: Diane    Date: Feb 08    Category: Java    Views: 968

I'm looking for a solution/technology in Java, which can handle my object
IN MEMORY and preserve their RELATIONS. I don't wanna have a (virtual)
database back bone, so well known solutions such as Hibernate and JDO
don't work out for me. I just want to express my relation (e.g. 1:N) and
PKs some how then ask for a simple object management. Such an "entity
manager" would simply invoke new() on any object whenever he likes (not a

I know that writing such a thing is not so hard. By mixing up several
patterns like singleton and object pool I can do the above task, but just
wanted to know if anyone you have heard any OTS solution for it.



5 Answers Found

Answer #1    Answered By: Leon Evans     Answered On: Feb 08

How are you doing dude? I'm not sure that I understand correctly what you are
searching for, but a
few things poped-up in my mind:

1- DB4O @http://www.db4o.com/
2- BDB JE @ http://www.sleepycat.com/products/bdbje.html

and finally

3- http://www.prevayler.org/wiki.jsp

I guess Prevayler is probably what you are looking for.

Answer #2    Answered By: Garai Chalthoum     Answered On: Feb 08

Well, as you see the concept of a relational database exists most of the
time either sync(1,2) or async(3). Although these solutions  are great in
their case (esp. Prevayler), but they are not excatly what I'm looking
for. Among them db4o seems, well, closer to what I want and I'll give a
try in next days. Thanks for your response guru, and still looking for
other alternatives.

Answer #3    Answered By: Caitlin Brown     Answered On: Feb 08

You can create a singleton  Hashmap and keep your objects in that, you may simulate the relations as composition and stuff like that.this solution  works cool mostly.However if you what a “DB” then use
this http://www.prevayler.org/wiki.jsp

Answer #4    Answered By: Mamie Wallace     Answered On: Feb 08

A few years back  I wrote some classes that do just what you're talking
about. The main class is LookupTable, which inherits from
AbstractLookupTable. Take a look at the JavaDoc to see if this is
something you could use. If so, the cost is $5 USD for this class and
some other utility classes. You can reach me privately at
tim@... . Make sure to include "[Utilities.java]" in the
subject line.

Answer #5    Answered By: Randy Warren     Answered On: Feb 08

one alternative could be fastlane reader pattern. this is mainly used for tabular RO data access. apparently you already have some solutions. fastlane reader has been well tested with complex data relationships (1:n, n:n). this can be used for caching, but your cache can be updated as you run queries, so physical disk access is inevitable.

if you need data manupulation (other can readonly access) nothing stops you from enhancing fastlane reader.merging this with TO, TOA pattern and value list handler can be a optimum in house solution.

Didn't find what you were looking for? Find more on Looking for a simple in memory ORM solution Or get search suggestion and latest updates.