You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by Apache Wiki <wi...@apache.org> on 2006/11/14 21:09:11 UTC

[Db-derby Wiki] Update of "HowToChangeLogRecords" by BryanPendleton

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:
http://wiki.apache.org/db-derby/HowToChangeLogRecords

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 record.

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.