I'm not sure which OSGi framework you are using. If you are running on Eclipse Equinox then you can make use of an Eclipse specific extension called "buddy classloading". However, this limits your ability to run your bundles on other OSGi frameworks.
Basically, you would create a DB4O bundle and add the following to it's bundle manifest:
Eclipse-BuddyPolicy: registered
In all your bundles which depends on the DB4O bundle to save and load objects you would ad the following to the manifests:
Eclipse-RegisterBuddy: com.db4o
Note, "com.db4o" is the bundle symbolic name of the DB4O bundle you created.
For more details about buddy classloading please checkout:
- http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/buddy_loading.html
- http://wiki.eclipse.org/Context_Class_Loader_Enhancements#Buddy_Class_Loading
--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/