×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question RMS Update issue

    Hi everyone!!

    Could any one solve my issue...
    I have created an LWUIT table in which the records are fetched from the RMS. when i update the records it will update the records but when i am exiting the application. and opens once again. that particular record hides from the table.

    One more thing when i use rs.getNumberRecords(); it will give total records including the hidden record..
    What this all is happening i am stuck..

    Please reply,
    It's urgent..

  2. #2
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    Re: RMS Update issue

    After update the record in RMS.
    I think rs.Commit(); should be execute.

  3. #3
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: RMS Update issue

    where is rs.commit() method , i can't find it.

  4. #4
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: RMS Update issue

    Quote Originally Posted by nitinverma274 View Post
    After update the record in RMS.
    I think rs.Commit(); should be execute.
    where is rs.commit() ... waiting for the reply...

  5. #5
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    Re: RMS Update issue

    Apolozy,
    Commit method is not for RMS.

    Are you Properly closing the RecorStore after writing the Data.

  6. #6
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: RMS Update issue

    Hi everyone !!

    When i am updating the data in RMS , the value is updated but all other values got null.. is this the issue... because when i use rs.getRecord(int id), after updation. the out of 10 fields the values of 5 are updated and others are saved as null.

    Why this all is happening...

    I want to update 5 fields out of 10 fields in RMS... how this is possible...

    Please Reply
    It's urgent
    Last edited by rajan701v; 2010-12-09 at 14:24.

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

    Re: RMS Update issue

    Quote Originally Posted by rajan701v View Post
    Hi everyone !!

    When i am updating the data in RMS , the value is updated but all other values got null.. is this the issue... because when i use rs.getRecord(int id), after updation. the out of 10 fields the values of 5 are updated and others are saved as null.

    Why this all is happening...

    I want to update 5 fields out of 10 fields in RMS... how this is possible...

    Please Reply
    It's urgent
    Cut&paste your method where you are trying to update the record store, are you using set Record or adding new records and removing the old ones.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  8. #8
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: RMS Update issue

    Quote Originally Posted by im2amit View Post
    Cut&paste your method where you are trying to update the record store, are you using set Record or adding new records and removing the old ones.
    I am using setRecord method to update the record..

    Now, i copy the data which is previously saved, in other variable before updating the record and using these values while updating the records.. i.e. i have used 5 old values and update the record with these 5 values and 5 new values out of 10 values.

    One more thing i want to know, how can i fetche the updated record at runtime... i'm confused. i have used re.enumerate("","",true);
    And also used re.keepUpdated(true); But nothing happens..
    The thing is after updating the record in rms i have to show the updated record in LWUIT tabular format. but it is showing the previous value(not updated value). But when i am calling the same according to rs.getRecord(int id); it is showing the updated record.

    Please reply soon............

    Thanx in advance rajan

  9. #9
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    Re: RMS Update issue

    I would not use the setRecord method, because it makes problems like you have. I would completely delete the RecordStore, and would write it again (instead of update). I got the same problems you have, when I used setRecord method, and for this reason I completely delete the RecordStore, and create it new.

    You should only use 2 methods, writeRS and readRS, for example language settings:

    Code:
        public void writeRS(String language) {
            try {
                RecordStore.deleteRecordStore("Language");
                RecordStore rs = RecordStore.openRecordStore("Language", true);
                rs.addRecord(language.getBytes(), 0, language.getBytes().length);
                rs.closeRecordStore();
            } catch (RecordStoreException rse) {
                rse.printStackTrace();
            }
        }
    
    public String readRS() {
            String language = "English";
            try {
                RecordStore rs = RecordStore.openRecordStore("Language", true);
                if (rs.getNumRecords() == 0) {
                    rs.addRecord("Language".getBytes(), 0, "Language".getBytes().length);
                } else {
                    language= new String(rs.getRecord(1));
                }
                rs.closeRecordStore();
            } catch (RecordStoreException rse) {
                rse.printStackTrace();
            }
            return language;
        }
    The standard language is English (first time you start the app e.g.). If you change the language, it will completely delete the RecordStore("Language), and write it again.

    AND DANGER:
    If you want to get a String from Byte, use: myString = new String(myByte) instead of myString = myByte.toString().
    myString = myByte.toString() does not work for me...

  10. #10
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: RMS Update issue

    Thanx for the reply guys...

    But,
    I think this may be the issue...
    I am opening all the recordstore in startApp();
    And closing all the recordsStore when exit the midlet..
    May be this way i am not getting the updated value at runtime...


    Please Help..........

  11. #11
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    Re: RMS Update issue

    I am opening all the recordstore in startApp();
    And closing all the recordsStore when exit the midlet..
    Changes in RMS only take effect, if you close the RMS.

    It would be easier for us, if you post your sourcecode. You can also change it into pseudocode.

  12. #12
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: RMS Update issue

    Can any one please tell me ???
    I am updating the record using setRecord method in rms.But database not updating at runtime
    even i m closing the recordStore ....

    Please reply...
    Last edited by rajan701v; 2010-12-18 at 07:20. Reason: No one giving the answer

  13. #13
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: RMS Update issue

    Quote Originally Posted by carsamba55 View Post
    Changes in RMS only take effect, if you close the RMS.

    It would be easier for us, if you post your sourcecode. You can also change it into pseudocode.
    How can i change the code in Pseudocode please tell me...??? or give me some link for the same....

    And one more question can u brief me about PerstLite for J2ME,


    Please .....''''''.....''''''.... Reply....
    Last edited by rajan701v; 2010-12-18 at 07:32.

  14. #14
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    Re: RMS Update issue

    @rajan701v
    Pseudocode is your code written in your own words, f.e. like this:
    OPEN RS
    FOR i
    ADD value1,value2,
    CLOSE RS


    Have you tried what iw wrote in #10, without setRecord method?

Similar Threads

  1. RMS UPDATE PROBLEM
    By arun09 in forum Mobile Java General
    Replies: 7
    Last Post: 2010-12-10, 06:22
  2. RMS- Save and Update
    By devalin85 in forum Mobile Java General
    Replies: 5
    Last Post: 2010-03-12, 07:07
  3. RMS - save and update
    By devalin85 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2010-03-02, 12:03
  4. Replies: 4
    Last Post: 2006-12-27, 16:39
  5. update rms via ota
    By kevin1964 in forum Mobile Java General
    Replies: 2
    Last Post: 2006-02-21, 07:32

Posting Permissions

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