db4o on Java Platforms

This topic applies to Java version only

All Java

JDK1.1

The major limitations of db4o for JDK1.1:

db4o for Java 1.1 also goes without support for Native Query Optimization. NQ optimization uses bytecode optimizer library Bloat (http://www.cs.purdue.edu/s3/projects/bloat/), which is not JDK1.1 compatible.

JDK1.2 - JDK 1.3

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.

JDK 1.4

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.

JDK 1.5

Mobile Java editions

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:

Which db4o Java version to use?

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.