Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Java Micro Edition and the fly likes Record store gets overwritten Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Record store gets overwritten" Watch "Record store gets overwritten" New topic

Record store gets overwritten

kalyen kumar
Ranch Hand

Joined: Sep 18, 2008
Posts: 53

I wrote a j2me simple application for RMS.
For the first time I add 2 records.

Now running my application prints

key1 = value1
key2 = value2

Next I exit my midlet, I mean I close my emulator.
Now I modify the above code to add another 2 more records.

Now running my application again prints

key3 = value3
key4 = value4

instead of

key1 = value1
key2 = value2
key3 = value3
key4 = value4

I create my record store as

Any idea, why my records in record store are getting overwritten...?

Thanks in advance

kalyen kumar
Ranch Hand

Joined: Sep 18, 2008
Posts: 53
Hey I figured it out....

RMS data is lost after the emulator exits.This is a normal characteristic of the emulator.
To keep RMS data, you need to "install" the application on the emulator.

Thanks everybody.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

kalyen kumar wrote:

Thanks everybody for giving me the opportunity to find the answer for myself.

Sarcasm? I hope not. We don't get paid here, so questions get answered if/when someone finds it convenient. Fortunately, we get enough traffic that lots of people are available to find it convenient.

But at least it didn't take you too long. And thanks for letting us know!

An IDE is no substitute for an Intelligent Developer.
kalyen kumar
Ranch Hand

Joined: Sep 18, 2008
Posts: 53

Hey, Its not....
Please consider it in a positive way, I was really happy to find the answer for myself.
I apologize, if that line in my posting hurts anybody in anyway.

I know that you guys are not paid for this and you are helping us......
so that is why I continued my trials to find the answer after posting the question.

I would have not posted the answer that I found, if I feel that you guys are not responding.
The reasons are for my posting are:-

1) As I am new to j2me, I wanted someone, if willing to confirm that I am on the right path.
2) If the answer I posted is correct it would help some who is facing the same problem.

Please note that I am not very new member and I already got very good answers from members here to my previous questions.
I am not here to hurt anybody, I am here to learn something from you all....
I feel that i need to remove that line in my posting.......these actions are purely for your comfort but not an acceptance that its sarcasm.

I agree. Here's the link:
subject: Record store gets overwritten
It's not a secret anymore!