db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "HowToChangeLogRecords" by BryanPendleton
Date Tue, 14 Nov 2006 20:09:11 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by BryanPendleton:

New page:
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.  
 * For soft upgrade you need to always read/write the old log record.  
 * For hard upgrade you need to write new format and be able to read both old and new log

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

== Implementing the new Log Record == 

You can save copying code by having the new log record extend the existing one and just update
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.

View raw message