• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RecordStore.getVersion()

 
Chris Gastin
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my studying I have come to read that returns an , which represents the number of times a record has been changed (add, delete and changed).

If it the RecordStore keeps track of a version number when the file has been deleted, then is the record still accessible after it has been deleted? Is a delete a physical removal of a record or just marking it as deleted like the SCJD exam has you do? Is this correct, or is what I have read off base?
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
recordStore.getVersion() is not just for a record. I guess you might be wrong in interpreting the sentence in the MIDP 2.0 specification...

That method is for all the records in a certain record store... So deletion of a record in your case is not a matter here... FYI, I extracted some part of the API here...


getVersion()
Declaration:
public int getVersion()
throws RecordStoreNotOpenException

Description:
Each time a record store is modified (by addRecord, setRecord, or deleteRecord methods) its version is incremented. This can be used by MIDlets to quickly tell if anything has been modified............
 
Sathya Srinivasan
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ko Ko is right.

The version counts the number of modifications made on the RecordStore. So, the version number is accessible as long as the RecordStore itself is accessible.

The number is given merely to help the application in determining how many times the RecordStore has been 'touched'.
 
Chris Gastin
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I did mis interpret. I thoght it was at the record level. I see now that it is at the record store level.

Thanks guys. I might make it through this exam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic