Skip to main content

RecordStore problem

1 reply [Last post]
Joined: 2006-12-15


I have a few questions concerning using RecordStore class in MIDP 2.0
specification. Questions concern my understanding of the notion of
atomicity of data record to RecordStore. In documents, it says that :
"Record store implementations ensure that all individual record store
operations are atomic, synchronous, and serialized, so no corruption
will occur with multiple accesses".

1. are the operations atomic when it comes to breakdowns? what happens
to the content of record if, duirng its updating (invoking setRecord,
addRecord), inwhich there were data, the power is cut off? will the
old(previous) data be stored or only new data will be preserved? is
thecontent somehow determined?
2. what happens if on opened and modified RecordStore, before closing
the application or in case of power cut off, the closeRecordStore()
won't be invoked?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-03-04


Here's the answer from Sun's MIDP expert:

The requirement is only for atomic update of individual records.
But is should hold even if there is a power failure.
It would be undetermined if the old or new record was stored.

The requirement is hard to test due to the timing requirement of the "breakdown".

There are some phones that violate the spec and return before the record is written.
They do it to get higher performance on writes.

Hope this helps.

-- Terrence

Terrence Barr
Evangelist, Java Mobile & Embedded Community
Sun Microsystems, Germany