1

I'm in the process of evaluating db4o and I have a pretty simple question. Does the db4o configuration settings (e.g. Transparent Activation) and indexes need to be setup each time the application runs and/or the database is loaded, or can all this be setup at the time the database is created?

For reference - I'm building an Android application and the database is going to be prebuilt on the desktop and shipped with the app.

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210
Jason L.
  • 2,464
  • 1
  • 23
  • 41

2 Answers2

1

After more digging in the documentation for db4o I found my answer :)

"Configuration settings are not stored in db4o database files. Accordingly the same configuration has to be submitted every time an ObjectContainer/ObjectServer is opened. For using db4o in client/server mode it is recommended to use the same configuration on the server and on the client. To set this up nicely it makes sense to create one application class with one method that creates an appropriate configuration and to deploy this class both to the server and to all clients."

Jason L.
  • 2,464
  • 1
  • 23
  • 41
  • 1
    That's true in general. But there are a few exceptions. One of them are indexes, which are persistent. However I would recommend to still configure indexes on every startup, just for documentations-sake. If you add the index to your configuration every time it just will use the existing index or create one otherwise. – Gamlor Dec 11 '10 at 08:34
  • The documentation value is better still if you use the @Indexed annotation to configure your indices. – Jules Jul 13 '12 at 12:09
1

just as an FYI, there is an exception .. indexes once created are saved and will be used regardless of their specification at OpenFile/Connection time.

Best, Robert

Robert
  • 368
  • 2
  • 8
  • Awesome, that's good to know. I have no problem with the configuration being set at load time but was getting a little worried about db4o re-indexing every time the database was loaded. Glad to know that's not the case! – Jason L. Dec 07 '10 at 19:16