Im working on integrating db4o into my project and I have some questions. I did read the manual and I tried out a few examples, but Im still not sure if I understood everything correctly. Please answer with yes/no (or other answers if there a questions which require this :-))
1.) Using ObjectContainer as a Singleton in an application is not recommended, because if different transactions work on the same object, there can be conflicts.
2.) So for concurrent transactions its recommended to use an embedded server.
3.) When using an embedded server (locally), you can open (and close) as much clients as you want, which have their own transaction and reference cache, so that they can work on the same objects. BUT - this is still not thread safe, because two clients might work on the same object, one client might change it and then the other won't update it.
4.) so - even if working with different clients, you need to make sure that the objects the clients work with are always up to date
5.) you can assure this with callbacks or explicit refreshing. but using callbacks would mean a lot of network traffic and explicit refreshing is complicated, because you really need to make sure when to update which object - so what would you recommend? and when would you refresh objects explicitly?
6.) as I try to write a DAO for db4o, I would implement methods for opening and closing the server and opening and closing the clients. I guess the server is only opened ONCE in an application, correct? (One Server per application?)
7.) Would you recommend lazy initialization? so that only the first time the server is needed, it is initialized.
8.) would you open a new client for every transaction?
9.) Assuming that I work with multiple transaction, but that they cant inflict each other, can I use one ObjectContainer for the whole project?
thank you for answering :-)