The important change in the conversion of the jobs table from version 3 to 4 consist of changing the type of forcemaxbytes from int to bigint. Futhermore a few defaults are set.

In princip this update consist of:

  1. ALTER TABLE jobs CHANGE COLUMN forcemaxbytes forcemaxbytes bigint not null default -1

  2. ALTER TABLE jobs CHANGE COLUMN num_configs num_configs int not null default 0

  3. UPDATE schemaversions SET version = 4 WHERE tablename = "jobs"

Because the NetArchiveSuite uses an old version of Derby, it is not possible to make the convertion via an ALTER TABLE command. Therefore the conversion for Derby databases makes the following steps:

  1. Checks that jobs table version is 3 (table schemaversions has entry ( tablename, version ) = ("jobs",3))
  2. Creates a table named backupJobs3to4
  3. Copies content of jobs table to backupJobs3to4
  4. Deletes jobs table (after checking that copy was completed successfully)
  5. Creates new (correct) jobs table
  6. Copies content of backupJobs3to4 table to jobs table
  7. Deletes backupJobs3to4 table (after checking that copy was completed successfully)
  8. Updates jobs table version to 4 (in table schemaversions)

This means that in case of crash of the system during update, it will either be the jobs table or the backupJobs3to4 that contains all original data (the one with most entries).

ConvertingJobsTableFromVersion3To4 (last edited 2010-08-16 10:24:39 by localhost)