views:

519

answers:

2

I have an Eclipse RCP application with an instance of an EMF model populated in memory. What is the best way to store that model for external systems to access? Access may occur during and after run time.

Reads and writes of the model are pretty balanced and can occur several times a second.

I think a database populated using Hibernate + Teneo + EMF would work nicely, but I want to know what other options are out there.

A: 

I'd go with Teneo to do the heavy lifting unless performance is a real problem (which it won't be unless your models are vast). Even if it is slow you can tune it using JPA annotations.

Rich Seller
+3  A: 

I'm using CDO (Connected Data Objects) in conjunction with EMF to do something similar. If you use the examples in the Eclipse wiki, it doesn't take too long to get it running. A couple of caveats:

1) For data that changes often, you probably will want to use nonAudit mode for your persistence. Otherwise, you'll save a new version of your EObject with every commit, retaining the old ones as well.

2) You can choose to commit every time your data changes, or you can choose to commit at less frequent intervals, depending on how frequently you need to publish your updates.

3) You also have fairly flexible locking options if you choose to do so.

My application uses Derby for persistence, though it will be migrated to SQL Server before long.

There's a 1 hour webinar on Eclipse Live (http://live.eclipse.org/node/635) that introduces CDO and gives some good examples of its usage.

Steve Robenalt