×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79

    In J2ME, How to re-index records in recordstore after deleting any record.

    am developing Location based j2me app & in that I using RMS to store data. In RecordStore when I delete any record, the underlying records doesn't get re-index. For example if I have 5 records & I delete record no.2 then record id will be 1 3 4 5. but I want record id after deletion should be in the form 1 2 3 4. How should I done this??? Because recordid playing important role in my app to retrieve & update the record. Plzzz help me as soon as possible I am stuck in my project here because of this problem.....

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: In J2ME, How to re-index records in recordstore after deleting any record.

    ID-s are not re-used by intent, it is a common thing in databasing. This way if you refer an ID from some other record (or from completely outside of the database), and that record gets deleted, later you will not get some totally unexpected record (reusing its ID) instead of the original record.
    Do not rely on continuous ID-s and a for-loop, use RecordEnumeration instead.

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: In J2ME, How to re-index records in recordstore after deleting any record.

    How much data are you storing?

    If the amount is small enough to fit in memory, you can manage all the data in memory... see ths article in the wiki.

    Many devices have problems with random inserts/deletes in RMS, and will corrupt data. Early Series 40 devices, and Series 60 5th Edition devices are examples. So, I generally recommend NOT deleting records in the way you describe.

  4. #4
    Registered User
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79

    Re: In J2ME, How to re-index records in recordstore after deleting any record.

    Quote Originally Posted by grahamhughes View Post
    How much data are you storing?

    If the amount is small enough to fit in memory, you can manage all the data in memory... see ths article in the wiki.

    Many devices have problems with random inserts/deletes in RMS, and will corrupt data. Early Series 40 devices, and Series 60 5th Edition devices are examples. So, I generally recommend NOT deleting records in the way you describe.
    There are only 5 records in my recordstore....

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: In J2ME, How to re-index records in recordstore after deleting any record.

    How big are the records? A few bytes, a few kilobytes? Or megabytes?

    I'm guessing they're small... so I'd recommend you do not manage them as separate records. Pack all the data into a single record, and unpack it later when you want it in memory. Save all the data in one record, and just update it.

Similar Threads

  1. problem while deleting a record (i'm new 2 j2me)
    By dinoabz in forum Mobile Java General
    Replies: 25
    Last Post: 2012-12-12, 11:50
  2. organize records in recordstore
    By bumble-bee in forum Mobile Java General
    Replies: 8
    Last Post: 2010-01-05, 17:15
  3. Records of RecordStore still available?
    By MelBreinesberger in forum Mobile Java General
    Replies: 1
    Last Post: 2006-03-17, 18:56
  4. nokia 3410 - problem with deleting records from a recordstore
    By tillstoschus in forum Mobile Java General
    Replies: 0
    Last Post: 2002-11-11, 21:24
  5. deleting records with asp and wml
    By Nokia_Archive in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2002-05-15, 20:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×