×

Discussion Board

Results 1 to 9 of 9

Thread: Rms data loss.

  1. #1
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Post Rms data loss.

    Hi,

    I have an J2me application which stores the data in the rms file using some access key.
    But sometimes, I am not getting the saved data which I want to update on the server.
    But it works fine with some other handset

    What could be the issue?


    thanks

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,553

    Re: Rms data loss.

    Hard to say... You could run out of space... The writing/saving fails for some other reason... Are you catching and handling all possible exceptions so that you know?

    You need to provide more details regarding your behaviour (the code you are using, info of the failing data, size of the records and record store, which device models you're seeing the problem on/with, and which you don't, etc.).

  3. #3
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: Rms data loss.

    Quote Originally Posted by petrib View Post
    Hard to say... You could run out of space... The writing/saving fails for some other reason... Are you catching and handling all possible exceptions so that you know?

    You need to provide more details regarding your behaviour (the code you are using, info of the failing data, size of the records and record store, which device models you're seeing the problem on/with, and which you don't, etc.).
    Hi,

    Actually there is enough space on the mobile (space where the midlet is installed).
    In my application I am creating 3-4 rms files which are different from each other.
    The rms which I am refering is the least accessed Rms and even if i tried to save the data again it also fails.
    But if I try with the same appln with some other handset it works fine.

    As per me, I feel that it is not the code issue.
    I found this problem in nokia c1 whereas I am getting any issue with Nokia 2700 classic

    thanks
    Suraj

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Rms data loss.

    Quote Originally Posted by suraj03 View Post
    Hi,

    Actually there is enough space on the mobile (space where the midlet is installed).
    In my application I am creating 3-4 rms files which are different from each other.
    The rms which I am refering is the least accessed Rms and even if i tried to save the data again it also fails.
    But if I try with the same appln with some other handset it works fine.

    As per me, I feel that it is not the code issue.
    I found this problem in nokia c1 whereas I am getting any issue with Nokia 2700 classic

    thanks
    Suraj
    The problem may be because the RMS recordstore is getting corrupt, please check that you are closing the RMS every time after you use it.
    I have faced this issue with on Samsung devices in the past.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: Rms data loss.

    Quote Originally Posted by im2amit View Post
    The problem may be because the RMS recordstore is getting corrupt, please check that you are closing the RMS every time after you use it.
    I have faced this issue with on Samsung devices in the past.
    Hi,

    This is the code which I use to save the data in the rms file.
    In this code I had closed the rms after being used.
    try {
    rs = RecordStore.openRecordStore(strdb, true);

    /*
    if(getRecordRMSIdForInsert(fields[0],strdb)==-1)
    {
    retValue = rs.addRecord(bytes,0,bytes.length);
    }

    */

    int tempid=getRecordRMSStartId(fields[0],strdb);
    if(tempid==-1)
    {
    retValue = rs.addRecord(bytes,0,bytes.length);
    }
    else
    {

    rs.setRecord(tempid, bytes, 0, bytes.length);
    }



    rs.closeRecordStore();
    return retValue;
    }
    catch (Exception e) {
    return -1;
    }

    thanks,

    Suraj

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Rms data loss.

    If these RMS related operations are done in a thread, please make sure that RMS close is done before we exit the app or switch off the device... so that RMS is not corrupt or keep a backup duplicate copy of RMS, generally we have seen RMS corruptions in case of multiple deletes and adds or Update operations.... set.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  7. #7
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: Rms data loss.

    Quote Originally Posted by im2amit View Post
    If these RMS related operations are done in a thread, please make sure that RMS close is done before we exit the app or switch off the device... so that RMS is not corrupt or keep a backup duplicate copy of RMS, generally we have seen RMS corruptions in case of multiple deletes and adds or Update operations.... set.
    Hi,

    I am not using the thread to save the data
    Secondly in my code I had used "rs.closeRecordStore()" to close the rms file.
    Is it something more is required to close rms.

    thanks,

    Suraj

  8. #8
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: Rms data loss.

    Hi,

    What, if suppose I delete the record store after each transaction (updating the data on the server)
    and create the new one for the next transaction.

    thanks
    suraj

  9. #9
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Rms data loss.

    Quote Originally Posted by suraj03 View Post
    Hi,

    What, if suppose I delete the record store after each transaction (updating the data on the server)
    and create the new one for the next transaction.

    thanks
    suraj
    This might also be reason for the corruption of the recordstore because J2me depends on the native file system to delete old RMS recordstore and create new one - which may not be done by the native OS just then in realtime and hence data loss is possible.

    Work around - always use a new name to create the RMS and delete the old one or just keep the records in a transaction table which need to be send to the server and delete only the records not the recordstore everytime.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. GPS Data Loss after some time
    By bilgic in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2011-06-29, 18:20
  2. AudioInputStream: is there data loss?
    By malemarco in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-05, 10:42
  3. 6680 image data loss in game
    By Gorky77 in forum Mobile Java General
    Replies: 3
    Last Post: 2005-08-17, 10:55
  4. data loss in bluethooth connection
    By saurbh_g in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-04-08, 23:04
  5. data loss when emulators talk
    By saurbh_g in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-04-08, 22:36

Posting Permissions

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