DB4O Datastores

DataNucleus supports persisting/retrieving objects to/from DB4O datastores (using the datanucleus-db4o plugin). If you wish to contribute to this plugin either by contributing or by sponsoring particular functionality please contact us via the DataNucleus Forum.

Datastore Connection

DataNucleus supports 3 modes of operation of db4o - file-based, embedded-server-based and client-server based. In order to do so and to fit in with the JDO/JPA APIs we have defined the following means of connection.

The following persistence properties will connect to a local file-based DB4O running on your local machine

datanucleus.ConnectionURL=db4o:file:{my_db4o_file}
datanucleus.ConnectionUserName=
datanucleus.ConnectionPassword=

The filename {my_db4o_file} can be absolute OR relative (and not include the curly brackets!).

The following persistence properties will connect to embedded-server-based DB4O running on with a local file

datanucleus.ConnectionURL=db4o:server:{my_db4o_file}
datanucleus.ConnectionUserName=
datanucleus.ConnectionPassword=

The filename {my_db4o_file} can be absolute OR relative.

The following persistence properties will connect as a client to a TCP/IP DB4O Server

datanucleus.ConnectionURL=db4o:{db4o_host}:{db4o_port}
datanucleus.ConnectionUserName=
datanucleus.ConnectionPassword=

DB4O doesn't itself use such URLs so it was necessary to define this DataNucleus-specific way of addressing DB4O.

So you create your PersistenceManagerFactory or EntityManagerFactory with these properties. Thereafter you have the full power of the JDO or JPA APIs at your disposal, for your db4o datastore.



Queries

Access Platform allows you to query the objects in the datastore using the following

  • JDOQL - language based around the objects that are persisted and using Java-type syntax
  • JPQL - language based around the objects that are persisted and using SQL-like syntax
  • Native - DB4Os own type-safe query language
  • SQL - SQL queries of DB4O


Known Limitations

The following are known limitations of the current implementation

  • DB4O only allows versions to be of type long . This means that you cannot use the JDO version strategy of "DATE_TIME".