Well if your database is that big, it seems unlikely your users will access
all the records during a single session. So locking all the records will
take a lot of time at launch time, and will be pretty useless.

What I would rather do is lock the records when accessing them, but only if
required (using MemHandleLockCount) to avoir overlocking.

Then, when exiting the app (or when lacking memory), you can call
DmResetRecordStates to unlock all your records.


> De�: Greg Lutz <[EMAIL PROTECTED]>
> R�pondre �: [EMAIL PROTECTED]
> Date�: Thu, 04 Nov 1999 14:18:48 -0800
> ��: "Palm Developers Forum List" <[EMAIL PROTECTED]>
> Objet�: Locking a whole database
> 
> I am developing a PalmOS application which uses a large (about
> 1mb) read-only database. Since it is read-only, I plan to use
> DmQueryRecord() instead of DmGetRecord() for data access.  This
> is an improvement, but even so, the constant handle locking and
> unlocking (and particularly the associated bookkeeping) seems
> like an unfortunate lot of wasted motion. I would like to simply
> lock all the records at the beginning of execution and unlock
> them at the end.  I know this sounds radical, but where's the
> harm?  The application performs a bit of read-write database
> activity on other, very small, databases, so conceivably, having
> all the records of the main database locked in memory could
> somewhat restrict the read-write databases' growth
> opportunities.  In theory, this could be solved by forcing the
> main database's records all to be consecutive in storage,
> preferably at the bottom or top of the heap they reside in.  Does
> anyone know of any way of forcing such reordering to occur; and
> does anyone see any pitfalls in this approach to database handling?
> 
> Thanks,
> Greg Lutz 
> 
> 

Reply via email to