Questions tagged [persistent-storage]

Persistent storage describes a mechanism that preserves the value of data over the lifetime of an executed script or program.

Persistent Storage in JavaScript

The persistent storage or "Web Storage" mechanism has been introduced with the draft of the HTML5 standard. JavaScript provides two different objects for this purpose:

  • sessionStorage

    The values saved to the sessionStorage object are valid for the length of a browsing session. They are only accessible from the browser (or tab) that initially stored the data. Access is not limited to pages of the same domain.

  • localStorage

    The values saved to the localStorage object are valid until explicitly removed via JavaScript. The localStorage object is unique to each domain.

Usage

A Web Storage object can only save strings. If it is required to save non-string data, the best approach is to use the JSON.stringify() function.

The two most important functions are getItem and setItem. In order to write a value to the session storage, the following action has to be taken:

sessionStorage.setItem("myKey", "myValue");

To read the just-saved value, the following action is required:

sessionStorage.getItem("test");

Further objects and methods provided by the Web Storage are described here:

Compatibility

Most modern browsers support Web Storage nowadays.
A fallback solution that is able to use Cookies if no Web Storage is available is Lawnchair

Persistent Storage in other languages

Languages like Android-Java, Python or VBA also provide mechanisms to preserve the values of certain variables over the lifetime of the program.

463 questions
0
votes
2 answers

Transformable images stored in CoreData - will it work with pre-seeded database?

If I use the "Transformable" attribute in Core Data to store images, it is my understanding that Core Data may or may not store it in the persistent store based on file size. Normally I wouldn't care where it stored the image, but for this app I…
soleil
  • 11,239
  • 29
  • 102
  • 172
0
votes
1 answer

Persistent Store save boolean as objects

I am developing a BlackBerry App and saving a lot of values as String and boolean to the Persistent Store. I am aware of the fact that String and boolean values do not get deleted from Persistent when an App is deleted/uninstalled from the handset.…
Sarah
  • 1,795
  • 1
  • 18
  • 39
0
votes
0 answers

Secure Persistant Caching in an iOS Static Framework

I am currently in the process of writing a static iOS framework that connects developers to my API and returns to them objectified information at their user's requests. However, in order for this framework to be worthwhile, one of the requirements…
Krejko
  • 792
  • 1
  • 6
  • 21
0
votes
1 answer

LDAP and Persistence Data?

I was just curious why an LDAP (Lightweight Directory Protocol) would or would not be considered persistence data?
eric MC
  • 756
  • 2
  • 8
  • 32
0
votes
1 answer

iOS Persist a custom NSObject

I'm interested in persistent storage for a custom annotation object CustomAnnotation : NSObject which has the following properties @property (nonatomic, assign) CGFloat val1; @property (nonatomic, retain) NSString *val2; @property…
Rohan Agarwal
  • 2,137
  • 1
  • 21
  • 34
0
votes
1 answer

Struts 2 value stack "Login attempt" counter not persisting variable

I am learning Struts 2 now and trying to make a login attempt counter to block any further login attempts after x failed attempts. Here is the body of my login.jsp

Blam
  • 473
  • 6
  • 14
0
votes
1 answer

BlackBerry - write and read from persistent object vector

I have a BlackBerry Application that sends messages to a server at fixed intervals. The messages are sent via web service using any of the connection methods available; Wifi, BIS, TCP/IP etc. Since the messages are being sent continuously, I need a…
Sarah
  • 1,795
  • 1
  • 18
  • 39
0
votes
1 answer

How does one retrieve a saved RDF::Redland persistent store?

The Redland library and the RDF::Redland bindings for Perl are very well documented when it comes to creating a persistent store and a model and parsing an RDF/XML file into it, for instance here and here. On the other hand, I cannot find any…
scozy
  • 2,411
  • 15
  • 34
0
votes
1 answer

Android internal storage, which mode should I use?

I'm making an app that has a listview with a child listview for each parent listview item. The children have a few children items as well. You can add/delete an element from any of these lists. I'm concerned that using MODE_APPEND will be a…
Tyler Pfaff
  • 4,288
  • 7
  • 41
  • 61
0
votes
1 answer

Fetch on Core Data works in simulator but not on device

I have an app where I present VC1 to pick a game and VC2 to submit plays for the selected game. When a user segues back from VC2 to VC1 I want to retain the game data for the game they were playing. Since it's iOS 6.0, I am using UIManagedDocument…
0
votes
2 answers

method to save object value outside session

The goal here is to have a servlet which has a button, when clicked creates a persistent Date() object outside of session memory i.e the variable value can be retrieved after closing the browser and accessing page. Wondering what the best approach…
bobbyrne01
  • 5,464
  • 13
  • 60
  • 127
0
votes
1 answer

What is the absolute fastest (yet reasonably reliable) way to persist data?

I'm exploring ways to receive and persist a very large number of requests (concurrent and across multiple servers) and I'm interested in views as to what is the fastest reliable way to store incoming packets of data for later processing. I've…
Harel
  • 1,751
  • 2
  • 22
  • 39
0
votes
2 answers

Confusion about Blackberry Sqlite db or Persistent Store

i am very confused about use of db or persistent store, if i use db then i have to store it on mmc because i have read some where that all BB devices do not allow to store db in phone memory, if i make db on mmc then user can delete it, and the…
Sandeep
  • 2,472
  • 3
  • 18
  • 28
0
votes
4 answers

store data in asp.net pages (Not Sessions)

I am creating 4 asp.net pages. first three pages have 'CONTINUE' button and last page has 'SUBMIT' button. I am not allowed to use Sessions to store first three pages data. and i need to use 'BACK' button on last three pages. when i click 'BACK'…
ARB
  • 255
  • 1
  • 6
  • 17
0
votes
1 answer

headMap of JDBM

I want to use JDBM for a rather large treeMap (a few hundred gigabytes if not some terabytes). Once created I'll use it heavily to answer headMap queries. Clearly, the answer headMap will be huge (on average half of the created database) but I'll…
arthur
  • 928
  • 2
  • 14
  • 28
1 2 3
30
31