Clive Walden wrote:
So I have to lock all the records I have accessed until I no longer want them,
otherwise they may become invalid even though I have not changed any data?

Yes, the chunks are relocateable in order to avoid memory fragmentation. Locking stops them from being relocated as long as there is at least one lock being held.

That will be OK as long as I can keep many Palm records locked at the same time.

That should be no problem. You should be able to lock virtually all the records on most devices. The only limitation will be on devices like the Treo 650 and Tungsten T5 where all locked records must be kept in the DBCache since everything else is in flash (which isn't processor-addressable memory). So, the practical limitation is that everything should be fine as long as you don't lock more than about 5 MB of data at once.

My understanding is that only 14 locks are possible on a single Palm record.

You can get around this by wrapping them in another lock which keeps its own lock count and locks the Palm record when transitioning from 0 to 1 and unlocks it when transitioning from 1 to 0. I do this in an app and it works fine.

If the Palm records have to be locked just to keep the pointers valid
and NOT just when I need to edit, what do I need to do to allow my one contact to be edited
(again remember no adds, deletes or size changes - The only editing is to toggle one byte between True and False).

Editing is a whole different ballgame from locking. To change a byte in a record, you must use DmWrite(). It should be OK to change just one byte within a record, because you can give a length and an offset within the record to DmWrite(). Other portions of the record should be unaffected.

  - Logan

To unsubscribe send an email to  [EMAIL PROTECTED]
--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to