Class COM.odi.Upgrade

java.lang.Object
   |
   +----COM.odi.Upgrade

public class Upgrade
extends Object
The Upgrade class is an abstract class that presents database upgrade facilities.


Method Index

 o upgradeDatabaseStringHash(String, boolean, boolean)
Upgrades the database to account for differences in the behavior of String.hashCode() between the JDK 1.1 and the JDK 1.2.

Methods

 o upgradeDatabaseStringHash
  public static void upgradeDatabaseStringHash(String dbName,
                                               boolean upgradeObjects,
                                               boolean multipleTransactions)
Upgrades the database to account for differences in the behavior of String.hashCode() between the JDK 1.1 and the JDK 1.2. Marks the database to note which versions of String.hashCode() are supported and upgrades instances of classes in ObjectStore packages in the database to use the current version if requested. Note that it is the application's responsibility to update instances of classes in other packages to account for differences in the behavior of String.hashCode().

To upgrade a database from the JDK 1.1 version of String.hashCode() to the JDK 1.2 version, run the upgrade from a Java virtual machine that uses the JDK 1.2 version and specify true as the value of upgradeObjects. After the upgrade, the database will only be accessible from Java virtual machines using the JDK 1.2 string hash code. Attempting to access the database using the JDK 1.1 version will throw DatabaseException.

To mark a database as not containing objects that depend on String.hashCode(), run the upgrade from any Java virtual and specify false for the value of upgradeObjects. After the upgrade, the database will be accessible from any Java virtual machine. Only perform this type of upgrade if your database does not contain any instances of classes OSHashtable or other classes that depend on String.hashCode(). Note that the upgrade does not check whether this is the case.

Note that this method cannot be used to modify databases that use the JDK 1.2 version of String.hashCode() to use the JDK 1.1 version.

Parameters:
dbName - The name of the database to be upgraded. The database must exist and be writable by the user.
upgradeObjects - If true, modify all instances of classes in ObjectStore packages to use the JDK 1.2 version of String.hashCode. If false, assumes that the database contains no objects that depend on String.hashCode and marks the database to permit it to be accessed from any Java virtual machine.
multipleTransactions - If true, each application instance that needs upgrading is upgraded in its own transaction. Set this parameter to true if attempting to upgrade without it throws an exception due to the size of the database being upgraded. If the Java VM runs out of heap space during an upgrade, first attempt to increase its heap space before using this option.

Throws: AccessViolationException
If you do not have access to the database.
Throws: DatabaseException
If the database cannot be upgraded, either because the current virtual machine needs to use the JDK 1.2 version of String.hashCode, or because the version of the database is not recognized.
Throws: DatabaseNotFoundException
If the database does not exist.
Throws: DatabaseUpgradeException
If the database is marked as already being upgraded as requested.
Throws: ObjectStoreException
If the current thread is not associated with a session and there is no global session.
Throws: TransactionInProgressException
If a transaction is in progress. This method starts and commits a transaction for a successful upgrade.
Throws: UpdateReadOnlyException
If the database cannot be opened for update.

Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.