Java Reference
In-Depth Information
Within a MIDlet suite, MIDlets can create record stores with case-sensitive names up to 32
Unicode characters long. Inside a MIDlet suite, the names must be unique. However, MIDlets are
allowed to create record stores with the same name in different MIDlet suites. In that case, the
platform is responsible for handling them as separate record stores. Additionally, the platform is
responsible for deleting the record stores that are created by a MIDlet on the device when the
MIDlet is deleted.
All operations on the record store are atomic. That means that if two threads write the same record
in parallel, these calls are serialized by the system automatically. This process avoids corruption of
the internal structure of the record store, but does not prevent the application data structure from
becoming invalid: Serializing two write operations to the same record means that the second write
operation overwrites the result of the previous operation, possibly causing application problems.
The RMS API does not provide any predefined mechanisms for locking transactions.
The record store maintains a date/time stamp indicating the last modification of the record store
and a version number. The date/time stamp consists of a long integer representing the time in the
format of the System.currentTimeMillis() method. Each time the record store is modified,
the date/time stamp is updated. The version number is represented by an integer value. It is
incremented for each modifying operation on the record store.
The primary key to records in a record store is an integer value called the record ID. The ID of the
first record created is 1. The IDs of subsequent records are incremented by 1.
Basic Functionality of the Class RecordStore
Record stores are represented in the RMS API by the class RecordStore . The RecordStore class
provides methods to open, close, read, and manipulate the record store. It also provides access to meta-
information such as the number of records and the memory space still available and currently
consumed.
Global Record Store Methods and Exceptions
 
Search WWH ::




Custom Search