Thursday, January 13, 2005

Walking: Java Object Persistence

I went to a presentation of the St. Louis Java User's Group tonight where Patrick Linskey of Solarmetric talked about advances in object persistence and some things coming soonish. He gave an overview of issues surrounding object persistence, discussed Java Data Objects, and went on to discuss the current collaboration between the Enterprise JavaBeans 3.0 working group and the Java Data Objects (JDO) 2.0 working group.

I've worked on this problem in the past, but it's been years since I took a serious look at the state of the art. Things have gotten much nicer than they used to be. It's time to go tinker...

1 comment:

Jeff Brown said...

Brian,

If you are going to start tinkering with JDO, let me make a recommendation for implementations that I think are good starting places.

The 2 free implementations that I would recommend someone use if they want to do some experimenting and playing around are JPOX and ObjectDb.

JPOX has been named the reference implementation (RI) for JDO 2.0 and implements most of 2.0 already. Like most JDO implementations, JPOX sits on top of or in front of a relational database. I have been using it with MySql and that seems to work very well.

ObjectDb isn't really free but they do have a free version that is missing some features (not many), is limited to non-commercial use and is limited to storing 5,000 objects. See this feature list for details. One of the interesting things about ObjectDb is that it does not use a relational database as its store. ObjectDb is a pure object database of its own and its API is JDO. I don't see this is a great solution for most applications because you can't get to the data any other way, you must use JDO. For playing around it is nice because you don't have to have a relational database around, it is all self contained. It is interesting enough to be aware of and maybe play around with. Incidentally, at the JUG last night someone asked about JDO's support for garbage collection in the datastore. The speaker was correct in saying that there isn't anything in the JDO specification about that but ObjectDb claims to have that as an added feature (not in the free version though). I haven't experimented with it myself but the idea is that once objects in the database are no longer reachable by any query-able objects, those unreachable objects are deleted.

As far as I know, all of the above technologies should work on a Mac (I know you are a Mac OS X user of course). If you do end up doing some experimentation, I would definitely be interested in hearing how things go for you and in particular I would be interested in hearing if there are any Mac issues with any of this.