Hi everybody,

not sure if this is the right forum to ask this question, but I'm having a 
problem with DmSyncDatabase() on a Palm TX (PalmOS v5.49028).

In order to eliminate the problem, I have a very simplistic test program.  It 
basically opens a database with just one record in it, and updates this record 
over and over again in a loop, writing the value of the loop count into the 
record.  In each iteration, I call DmSyncDatabase(), which returns with no 
error.

Now, after about 9000 iterations I cause the device to be reset.  The way I do 
it is by calling ErrNonFatalDisplayIf().  Now, after the reset I use FileZ to 
inspect the record, and the value that's in there is always around 7460.  If I 
call SysReset(), everything seems to work, and the value in the record is 
correct.

My conclusion is (and correct me if I'm mistaken) that DmSyncDatabase() does 
not always wait until the data is really commited to the NAND Flash volume...  
If I put a little SysTaskDelay() in my test program right before calling 
ErrNonFatalDisplayIf(), and the delay is reasonably long, then I can see the 
correct value in the record after the reset.

Not sure what I'm doing wrong here, or if this is a known problem.  But how can 
I call DmSyncDatabase() in a way that you can trust it having the desired 
effect?  Does anybody have any suggestions?

Any help is greatly appreciated.

Thanks,

-- Thomas
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to