Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Nov 2003

    Open RecordStores

    Does keeping open RecordStores increase battery usage: I am asking because I open all stores on startApp() and only close them on exit. Is it more efficient to open only when needed and close immediately when no longer required?


  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Cheshire, UK
    I'd be surprised if keeping a record store open costs any battery life, but I must say that I don't really know.

    However, some Series 40 developers experience a strange problem with record stores. Sometimes, you start your application to find that the record store is in the same state as it was when your application started last time - that is, all additions, updates and deletes made by your app last time seem to have been "undone". It seems to be worse if the application terminates abnormally (such as when an exception is not caught, an out-of-memory error occurs, or when the red-button is pressed). This might suggest that the problem is caused by exiting the application with record stores still open.

    I now open, update and close in a single action, and I no longer experience the "lost updates" problem. Of course, it is entirely possible that other improvements to my working-practices have made the difference! But I have had to alter radically the way in which one application used RMS - twice! - and I know other developers who have had a similar job to get RMS to behave nicely. So you may want to structure your code so that you can change your mind without too many headaches...!


Posting Permissions

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