Sometimes a situation will arise in which the developer would like to change a log record format. For example DERBY-606 describes such a situation. Changing a log record format presents some special upgrade considerations, which the developer needs to be careful to consider.

Directly changing the format of a log record is not really allowed. What you need to do is support the old log record and add a new log record which has the changed format.

Once you have hard upgraded you don't have to worry about older versions of the software encountering this unknown new log record.

Also, note that if you choose a fix which in any way alters what is written, you basically have to add a new log record in case of hard upgrade (and bug will continue to exist in soft upgrade).

== Implementing the new Log Record ==

You can save copying code by having the new log record extend the existing one and just update the getTypeFormatId(), readExternal(), writeExternal() routines. This way soft upgrade can still read/write the old record. Need some code to write the new vs. the old one in case of hard upgrade.

HowToChangeLogRecords (last edited 2009-09-20 22:12:40 by localhost)