This topic applies to Java version only
The major limitations of db4o for JDK1.1:
no support for storing private fields (reflection in JDK 1.1 can only work on public fields)
no support for JDK collections (java.util.list since JDK1.2)
no support for weak references
Java JDKs after version 1.1 are free of JDK1.1 limitations mentioned above. You can also use Native Query Optimization since JDK1.2.
The main limitation of JDK1.2 - 1.3 is the lack of file locking functionality. As it is necessary to lock the database file in use, db4o simulates locking files by using a timer thread that writes access time to the file. This can be quite slow.
File locking functionality is available since JDK1.4, so that expensive database locking simulation is not necessary anymore and is advised to be switched off:
Db4o.configure().lockDatabaseFile(false)
Db4o can bypass the constructors declared for the class using platform-specific mechanisms. (For Java, this option is only available on JREs >= 1.4.) This mode allows reinstantiating objects even when their class doesn't provide a suitable constructor. For more information see Constructors chapter
If this option is available in the current runtime environment, it will be the default setting.
List <Pilot> pilots = db.query(new Predicate <Pilot>
() {
public boolean match(Pilot pilot) {
return pilot.getPoints() == 100;}});
Currently db4o runs on J2ME dialects that support reflection, such as Personal Java, J2ME CDC and J2ME PersonalProfile. PersonalJava is closely equivalent to Java 1.1.8 regarding the libraries and features it contains (see JDK1.1 for the list of limitations). Use db4o-x.x-java1.1.jar with PersonalJava.
J2ME CDC and J2ME PersonalProfile are based on subsets of JDK1.3 or JDK1.4 depending on the version used.
J2ME CLDC and MIDP are not yet supported. Their support requires:
Db4o comes with several jars supporting different java versions. Together with the advanced features of higher Java versions db4o provides valuable improvements to its functionality (see the comparison above).
To get the best functionality you must use the highest db4o java version that your virtual machine supports:
Java versions |
Recommended db4o jar |
JRE1.1 | db4o-x.x-java1.1.jar |
JRE1.2, JRE1.3, JRE1.4 | db4o-x.x-java1.2.jar |
JRE5, JRE6 | db4o-x.x-java5.jar |
When you use JRE1.4 you should use db4o-x-x-java1.2.jar with database locking simulation disabled:
Db4o.configure().lockDatabaseFile(false)
This will improve the performance dramatically, because JRE1.4 provides a built-in functionality to lock database files and the costly db4o database locking simulation is not needed.