[whatwg] RFC: Alternatives to storage mutex for cookies and localStorage

Robert O'Callahan robert at ocallahan.org
Tue Sep 8 01:41:39 PDT 2009


On Tue, Sep 8, 2009 at 7:00 PM, Aaron Boodman <aa at google.com> wrote:

> On Fri, Sep 4, 2009 at 12:02 AM, Chris Jones<cjones at mozilla.com> wrote:
> > I propose adding the functions
> >
> >  window.localStorage.beginTransaction()
> >  window.localStorage.commitTransaction()
> > or
> >  window.beginTransaction()
> >  window.commitTransaction()
>
> I think this is a good idea! I would modify it to follow the pattern
> set by the current SQLDatabase proposal, to have a callback, like
> this:
>
> window.localStorage.transaction(function() {
>  // use local storage here
> });
>
>
What is the intended semantics here? Chris' explicit commitTransaction would
throw an exception if the transaction was aborted due to data inconsistency,
leaving it up to the script to retry --- and making it clear to script
authors that non-storage side effects during the transaction are not undone.
How would you handle transaction aborts?

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090908/20af036a/attachment-0002.htm>


More information about the whatwg mailing list