This example shows usage of RMS. Many Java applications are using RMS with one record per record store. As a consequence there can be up to a few hundred record stores.
This approach has the benefit that finding a certain record is simple and porting the application from other platforms is simple as this usage pattern mimics file access. The drawback with this approach is that it often leads to an inefficient RMS usage pattern where the same record store is opened and closed repeatedly.
The example application demonstrates four different ways of using RMS:
RecordStore
is kept open between gets
RecordStore
is opened for every get/set
operation (not recommended way to use RMS)
RecordStore
with caching
File based record store (using JSR-75)
The application measures how long it takes to read 100 records with each approach. The application produces following results on Nokia 5800 (S60 5th Edition device):
RecordStore
is kept open between gets: 14 ms
RecordStore
is opened for every get/set operation: 360 ms
RecordStore
with caching: 6 ms
File based record store (using JSR-75): 1323 ms
The example application can be downloaded here.