DDH Software, LLC Making a big world smaller






Return to Knowledgebase Home
Question: What is the NVFS Workaround option in the Preferences?
Product: Article Number: 321Creation Date: 12/10/2007
Answer:
As you may know most all shipping Palm OS devices use Non Volatile
File Storage (NVFS), which means that the memory is stored in flash,
which doesn't get erased when the batteries die.  Unfortunately, due
to bugs in the design and implementation of the Palm OS NVFS system,
data loss is now more likely and resets more common than they were
before the 'enhancement' was made to start using NVFS memory.

Many of the bugs were addressed in future updates of the Palm OS, but
not all shipping devices have options to update to the latest Palm OS
revision and as of now, not all NVFS related issues have been fixed in
even the current shipping Palm OS revision.  Because of this, we have
see numerous customers suffer data loss at the hands of the NVFS
issues and sought out to see if there were any workarounds, reading
and discussing with other Palm OS programmers and Palm OS' development
team.  One thing we learned in the process is that:

1.  NVFS devices are more likely to reset unexpectedly because they have a RAM
memory cache that needs to flush out when full.  On some older
revisions/versions of Palm OS, this process rarely works as planned
and always results in a reset and data loss.  On newer (5.4.9 and higher) this works
more often than not because it was avoided by constant maintenance of
the DB Cache so it doesn't get full.

2.  When the device resets, the Palm OS tries to discover any
databases that may have been only partially written when the reset
happen and it just silently deletes them without any logging of this
or indication to the user.  This means that a database you had may
suddenly disappear when the device does reset.  This is most
exasperating to the user and that's completely understandable.  While
Palm has not explained it's method for determining an invalid
database, developers have gleaned the following cases that cause it be
wiped:

1.  If there are two databases or applications (to the Palm OS, every
app and database is all the same format) with the same name but differing only
by case (eg, MyPatients and mypatients) one will be deleted
automatically on a soft reset.  This one is easy to solve if you name
each database to be completely different than any programs or
databases you already are using.

2.  If the busy bit is set on any records, the Palm OS believes that
it was not properly/completely written to the NVFS storage and so it deletes
it.

3.  Some yet unknown causes.

We have found a few developers confirm a strange workaround for
keeping databases from disappearing.  They found that if they
reread/rewrote every record in the database that the database would
not be removed on reset.  We did some testing during the development
of v4.0 and found that a few test databases were able to cause to
delete on reset were actually not deleted after this experimental
operation.   So we ventured to place this into the regular operation
of closing a database.  Three problems came up:

1.  This process is negligible for most databases under 5000 records,
but it does add time and slow things down, and when you get to a
certain size, it can be come a nuisance or limiting factor in your
usage.

2.  In devices that have smaller DB Cache sizes, using this operation
can actually make things worse because reading and writing these
records can fill up the DB Cache and cause the aforementioned reset.
Since the database wasn't entirely written it will still be deleted.

3.  It's not a 100% cure as it only fixes one cause of database loss
on reset.

For this reason we decided to leave this as an optional preference
setting that users can experiment with to see if it helps with their
own data loss issues.  If you check the 'enable NVFS workaround' checkbox, this process will be enabled, otherwise it will close as normal.

This article has been viewed 2899 times.

Return to Knowledgebase Home