• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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
Hi

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

javax.microedition.rms.RecordStoreNotOpenException

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



Thanks
 
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.
 
Would you like to try a free sample? Today we are featuring tiny ads:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic