Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

I don't get how to close RMS

Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I don't get how to close Record Management System. I want to delete RecordStorages and this is proving to be very hard. All I want to do is this.

1. The user can create a RecordStore with any name.
2. The user can add records to any of these RecordStores.
3. The user can delete any record.
4. The user can delete any RecordStore.

Now what is happens the user first loads up the program. The user goes and makes a RecordStore by typing in a name. The form then displays this recordStore. The user can then choose to make another RecordStore,Delete the RecordStore or create a record.

Now if the user chooses to delete that recordStore right away it does not delete the RecordStore. The error message I get this:

javax.microedition.rms.RecordStoreException: deleteRecordStore error: record store is still open

So it is still open apparently. The thing is before I try to delete the stupid recordSet I close it. I even put a thread and slept the thing for like 5 seconds after closing it and it still came with that error up.

But if you try to delete it again right after you tried to delete it the first time it will work for whatever reason.

So the user has to hit delete twice to get it to delete once.

That is the first problem then the other problem is:

If I add a record to that record set I then need to click on the delete button 3 times to delete it once. I get the same exception as above.

The next problem is if I add another record set:

Then I get the first exception with it being open then one second try it give me this exception


So now it is bitching that it is not Open. Come on make up your mind do you want it closed? or Opened?

I find it stupid that you have to close every single Record in order to close just one of htem.

Here is basically the too methods that are doing all the work

Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Keep in mind you have to balance the open and close operations. That means if you call open 3 times you need to call close 3 times. It appears that you have an open operation in a loop but no corresponding close in the same loop.
Ruth Stout was famous for gardening naked. Just like this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
    Bookmark Topic Watch Topic
  • New Topic