• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MIDP 2.0 Persistent Storage

 
Rahul JG
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) A MIDlet in one MIDlet suite is allowed to have a record store with the same name as a MIDlet in another MIDlet suite.

2) Sharing of RecordStores is possible from MIDP2.0

If there are 2 RecordStores with the same name which reference would one get when RecordStore.openRecordStore() is called?
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that the name space and scope for a record store is among MIDlets WIHTIN the same MIDlet suit, not among diff MIDlet suits. So diff MIDlet suits can have the same name since they are in diff name space. If shared among diff MIDlet suits, suits name and vendor name also play a role for the name space. e.g: RecordStore.openRecordStore(String recordStoreName, String vendorName, String suiteName) Hope it can answer your question. Correct me if I am wrong.
[ August 26, 2004: Message edited by: Alibabra Sanjie ]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul JG:
1) A MIDlet in one MIDlet suite is allowed to have a record store with the same name as a MIDlet in another MIDlet suite.

2) Sharing of RecordStores is possible from MIDP2.0

If there are 2 RecordStores with the same name which reference would one get when RecordStore.openRecordStore() is called?


True for both statements...
If I am wrong not, the questions are from WhizLabs SCMAD Exam Simulator...

For the bullet number 2, new APIs in MIDP 2.0 allow for the explicit sharing of record stores if the MIDlet creating the RecordStore chooses to give such permission.

Alibabra got a good explanation to your question as well...
 
Rahul JG
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand it correctly:

<b>RecordStore.openRecordStore(String name, boolean create)</b> will always default to the namespace in the MIDlet is loaded. So even if there are two record stores with the same name, the one in the active namespace will be loaded.

To load a record store in a different namespace, use
<b>RecordStore.openRecordStore(String name, String vendor, String suite)</b>

By the way, I haven't referred to any mock exams as yet.
So its just a coincidence that the question happens to be from one of the mock exams.
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, simple it's that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic