Preserving Runtime Data

In some situations, it is possible to preserve user runtime data when installing a fresh JADE database or when copying runtime data directly from one database to another.

This is achieved by simply saving and restoring (or copying) the specific database files that contain your runtime data. These files are the _rootdef.dat file and all of the database files whose names do not begin with an underscore character (_). You specify these names when you define class maps for the classes in your schema.

Copying runtime database files is useful when you are performing any of the following actions.

When the runtime data contains direct references to schema objects such as classes, interfaces, properties, or methods, these references will no longer be valid when the schema is installed in a new database, as the object ids of these objects will almost certainly change during the load process.

If you want to retain direct references to schema objects, look up these objects dynamically rather than storing persistent references to them or write your own "fix up" code to correct the invalid references after you have restored the runtime data files.

To preserve your runtime data

  1. Extract your schema or schemas from your existing JADE database.

  2. Install the new database in a different directory.

  3. Load the schema or schemas into the new database.

  4. Copy the runtime data files from the old database to the new database.

    As a developer of the application, you should be aware of which files constitute the runtime data; that is, the _rootdef.dat file and all of the non-system files that you defined as map files in the schemas.

  5. Run the JADE Database utility (jdbutil) to override the timestamp mismatch for the runtime data files. For details, see "Resetting Timestamps", in Chapter 3 of the JADE Database Administration Guide.

The new database is now ready for use.

The preservation of runtime data will fail unpredictably if you change class structures after reloading the schema but before copying the runtime data.