Automatic Shutdown

This topic applies to Java version only

configuration.automaticShutDown(flag)

Advantage

Automatic shutdown ensures that all db4o processes are terminated correctly.

Effect

Depending on the JDK, db4o uses one of the following two methods to shut down, if no more references to the ObjectContainer are being held or the JVM terminates:

  • JDK 1.3 and above:
    Runtime.addShutdownHook()/code]
  • JDK 1.2 and below:
    System.runFinalizersOnExit(true)

and code in the finalizer.

AutomaticShutDown setting is true by default.

Alternate Strategies

Some JVMs have severe problems with both methods. For these rare cases the automaticShutDown feature may be turned off.