Chapter 6. Databases

As we described earlier, permanent data resides in memory. This memory is divided into two sections: the dynamic and storage heaps. Permanent data resides in the storage heap and is controlled by the Data Manager (the dynamic heap is managed strictly by the Memory Manager).

Data is organized into two components: databases and records. The relationship between the two is straightforward. A database is a related collection of records. Records are relocatable blocks of memory (handles). An individual record can’t exceed 64KB in size.

Overview of Databases and Records

A database, as a collection of records, maintains certain key information about each record (see Figure 6.1):

  • The location of the record.

  • A three-byte unique ID. This ID is unique only within a given database. It is assigned automatically by the Data Manager when the record is created.

  • A one-byte attribute. This attribute contains a 4-bit category, a deleted bit, a dirty bit, a busy bit, and a secret (or private) bit.

In the Palm 3.0 OS, there is one large storage heap; in previous versions, there were many small ones. A database resides in a storage heap, but its records need not be in the same heap (see Figure 6.1).

Database with two records in a database in persistent memory

Figure 6-1. Database with two records in a database in persistent memory

Databases also contain the following other types of information:

An application info block

This usually contains

Get Palm Programming: The Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.