java.io.Externalizable
, java.io.Serializable
, Formatable
, TypedFormat
public class DD_Version extends java.lang.Object implements Formatable
A word about minor vs. major upgraded. Minor upgrades must be backwards/forwards compatible. So they cannot version classes or introduce new classes. Major releases are only backwards compatible; they will run against an old database, but not the other way around. So they can introduce new classes, etc.
Modifier and Type | Field | Description |
---|---|---|
private DataDictionaryImpl |
bootingDictionary |
|
(package private) int |
majorVersionNumber |
|
private int |
minorVersionNumber |
Constructor | Description |
---|---|
DD_Version() |
Public niladic constructor needed for Formatable interface.
|
DD_Version(DataDictionaryImpl bootingDictionary,
int majorVersionNumber) |
Construct a Version for the currently booting data dictionary.
|
Modifier and Type | Method | Description |
---|---|---|
private void |
applySafeChanges(TransactionController tc,
int fromMajorVersionNumber,
int lastSoftUpgradeVersion) |
Apply changes that can safely be made in soft upgrade.
|
(package private) boolean |
checkVersion(int requiredMajorVersion,
java.lang.String feature) |
Check to see if a database has been upgraded to the required
level in order to use a language feature.
|
private void |
doFullUpgrade(TransactionController tc,
int fromMajorVersionNumber,
java.lang.String aid) |
Do full upgrade.
|
protected void |
dropSystemCatalog(TransactionController tc,
CatalogRowFactory crf) |
Drop a System catalog.
|
protected void |
dropSystemCatalogDescription(TransactionController tc,
TableDescriptor td) |
Remove the description of a System table from the data dictionary.
|
private int |
getJBMSMinorVersionNumber() |
Get the minor version from the JBMS product minor version/maint version.
|
int |
getTypeFormatId() |
Get the formatID which corresponds to this class.
|
private void |
handleMinorRevisionChange(TransactionController tc,
DD_Version fromVersion,
boolean softUpgradeRun) |
Do any work needed for a minor revision change.
|
private static boolean |
isFullUpgrade(java.util.Properties startParams,
java.lang.String oldVersionInfo) |
Privileged startup.
|
private static java.lang.String |
majorToString(int majorVersionNumber) |
|
private void |
modifySysTableNullability(TransactionController tc,
int catalogNum) |
Modifies the nullability of the system table corresponding
to the received catalog number.
|
void |
readExternal(java.io.ObjectInput in) |
Read this object from a stream of stored objects.
|
java.lang.String |
toString() |
Stringify this Version.
|
(package private) void |
upgradeIfNeeded(DD_Version dictionaryVersion,
TransactionController tc,
java.util.Properties startParams) |
Upgrade the data dictionary catalogs to the version represented by this
DD_Version.
|
void |
writeExternal(java.io.ObjectOutput out) |
Write this object to a stream of stored objects.
|
private transient DataDictionaryImpl bootingDictionary
int majorVersionNumber
private int minorVersionNumber
public DD_Version()
DD_Version(DataDictionaryImpl bootingDictionary, int majorVersionNumber)
bootingDictionary
- The booting dictionary that needs to be upgraded.public java.lang.String toString()
toString
in class java.lang.Object
private static java.lang.String majorToString(int majorVersionNumber)
void upgradeIfNeeded(DD_Version dictionaryVersion, TransactionController tc, java.util.Properties startParams) throws StandardException
dictionaryVersion
- the version of the data dictionary tables.StandardException
- Ooopsprivate void applySafeChanges(TransactionController tc, int fromMajorVersionNumber, int lastSoftUpgradeVersion) throws StandardException
tc
- transaction controllerfromMajorVersionNumber
- version of the on-disk databaselastSoftUpgradeVersion
- last engine to perform a soft upgrade that made changes.StandardException
- Standard Derby error policy.private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber, java.lang.String aid) throws StandardException
tc
- transaction controllerfromMajorVersionNumber
- version of the on-disk databaseaid
- AuthorizationID of current user to be made Database OwnerStandardException
- Standard Derby error policy.private void handleMinorRevisionChange(TransactionController tc, DD_Version fromVersion, boolean softUpgradeRun) throws StandardException
tc
- the xactStandardException
- Standard Derby error policy.protected void dropSystemCatalogDescription(TransactionController tc, TableDescriptor td) throws StandardException
tc
- TransactionControllertd
- Table descriptor for the catalog to drop.StandardException
- Standard Derby error policy.protected void dropSystemCatalog(TransactionController tc, CatalogRowFactory crf) throws StandardException
tc
- TransactionControllercrf
- CatalogRowFactory for the catalog to drop.StandardException
- Standard Derby error policy.public int getTypeFormatId()
getTypeFormatId
in interface TypedFormat
public final void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
in interface java.io.Externalizable
in
- read this.java.io.IOException
- on errorpublic final void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- write bytes here.java.io.IOException
- on errorprivate int getJBMSMinorVersionNumber()
private void modifySysTableNullability(TransactionController tc, int catalogNum) throws StandardException
tc
- TransactionController.catalogNum
- The catalog number corresponding
to the table for which we will modify the nullability.
OLD Cloudscape 5.1 upgrade code
If this corresponds to SYSALIASES, then the nullability of
the SYSALIASES.ALIASINFO column will be changed to true
(Beetle 4430). If this corresponds to SYSSTATEMENTS,
the nullability of the SYSSTATEMENTS.LASTCOMPILED
column will be changed to true.
Derby upgrade code
If this corresponds to SYSSTATEMENTS, then the nullability of
the SYSSTATEMENTS.COMPILATION_SCHEMAID column will
be changed to true. If this corresponds to SYSVIEWS, the nullability
of the SYSVIEWS.COMPILATION_SCHEMAID column will be changed to true.StandardException
- Thrown on errorboolean checkVersion(int requiredMajorVersion, java.lang.String feature) throws StandardException
requiredMajorVersion
- Data Dictionary major versionfeature
- Non-null to throw an error, null to return the state of the version match.StandardException
private static boolean isFullUpgrade(java.util.Properties startParams, java.lang.String oldVersionInfo) throws StandardException
StandardException
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.