W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2013

Re: IndexedDB events for object storage add, put and delete

From: Michael Nordman <michaeln@google.com>
Date: Tue, 5 Feb 2013 14:39:09 -0800
Message-ID: <CAHpoE=gpOpTx3VPw_J+nJ2jB8thCD9xH=b6w99QjaoLuyL+-pQ@mail.gmail.com>
To: "piranna@gmail.com" <piranna@gmail.com>
Cc: Dale Harvey <dale@arandomurl.com>, Miko Nieminen <miko.nieminen@iki.fi>, public-webapps WG <public-webapps@w3.org>
This could be accomplished with a separate pub/sub capability, instead of
complicating the IDB interfaces and allocating new functions to that
component.

We (chromium project) have open bug about a "broadcastMessage" function.
https://code.google.com/p/chromium/issues/detail?id=161070


On Tue, Feb 5, 2013 at 2:21 PM, piranna@gmail.com <piranna@gmail.com> wrote:

> This should also be added, then...
>
> 2013/2/5 Dale Harvey <dale@arandomurl.com>:
> > They can, I was just saying that they wont do that by default (as I
> assume a
> > native implementation would), you need to write your own messaging system
> > out of band
> >
> > Cheers
> > Dale
> >
> >
> > On 5 February 2013 22:12, piranna@gmail.com <piranna@gmail.com> wrote:
> >>
> >> Why it can propagate over tabs if all of them are accessing to the
> >> same database?
> >>
> >> 2013/2/5 Dale Harvey <dale@arandomurl.com>:
> >> > The problem with emitting change notification on writes is that they
> >> > dont
> >> > propogate across tabs, my library has to use localstorage to emit
> events
> >> > across tabls and keep track of a change sequence in each tab
> >> >
> >> > This would be a welcome addition to the spec (after we get to
> enumerate
> >> > databases) :)
> >> >
> >> >
> >> > On 5 February 2013 21:59, piranna@gmail.com <piranna@gmail.com>
> wrote:
> >> >>
> >> >> One solution would be to don't call directly to IndexedDB methods but
> >> >> instead use custom wrappers that fit better with your application
> >> >> (this is what I'm doing), but definitelly I totally agree with you
> >> >> that IndexedDB should raise events when a row has been
> >> >> inserted/updated/deleted. I think it was talked about it would be an
> >> >> explosion of events, but I'm not sure about this... having events
> >> >> would be useful to develop triggers to maintain database consistency,
> >> >> for example :-)
> >> >>
> >> >> 2013/2/5 Miko Nieminen <miko.nieminen@iki.fi>:
> >> >> > Hi,
> >> >> >
> >> >> > I'm new to this forum and I'm not completely sure if I'm posting to
> >> >> > right
> >> >> > list. I hope I am.
> >> >> >
> >> >> > I've been playing with IndexedDB to learn how to use it and around
> >> >> > this
> >> >> > experiment I wrote a blog article about my experiences.
> >> >> >
> >> >> > While writing my article, I realized there is no way to add event
> >> >> > listeners
> >> >> > for object store to get notifications when new object is added,
> >> >> > existing
> >> >> > one
> >> >> > is modified or one is deleted. I think lack of these events makes
> >> >> > some
> >> >> > use
> >> >> > cases much more complicated than one would hope. Use cases like
> >> >> > keeping
> >> >> > local data in sync with remote database, synchronizing views
> between
> >> >> > multiple windows or creating generic data indexers or manipulation
> >> >> > libraries. I know there are ways to go around the lack of these
> >> >> > events,
> >> >> > but
> >> >> > having those would make things much easier.
> >> >> >
> >> >> > Is there any reason why these are not included in the
> specification?
> >> >> > It
> >> >> > just
> >> >> > feels bit strange when similar mechanism is included in WebStorage
> >> >> > API,
> >> >> > but
> >> >> > not in IDB. I suppose right moment to emit these events would be
> just
> >> >> > after
> >> >> > emitting transaction complete.
> >> >> >
> >> >> > I wasn't able to find any references from the archives and I hope
> I'm
> >> >> > not
> >> >> > asking same question again. Also I hope I'm not asking this
> question
> >> >> > too
> >> >> > late.
> >> >> >
> >> >> > My blog article talks about this in a bit more detailed level under
> >> >> > header
> >> >> > "Shortcomings of IndexedDB".. The whole article is quite long so
> you
> >> >> > might
> >> >> > want to skip most of it. You can find it from
> >> >> >
> >> >> >
> >> >> >
> http://mini-thinking.blogspot.co.uk/2013/02/web-app-example-using-indexeddb.html
> >> >> >
> >> >> > Thanks,
> >> >> > --
> >> >> > Miko Nieminen
> >> >> > miko.nieminen@iki.fi
> >> >> > miko.nieminen@gmail.com
> >> >> >
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> "Si quieres viajar alrededor del mundo y ser invitado a hablar en un
> >> >> monton de sitios diferentes, simplemente escribe un sistema operativo
> >> >> Unix."
> >> >>  Linus Tordvals, creador del sistema operativo Linux
> >> >>
> >> >
> >>
> >>
> >>
> >> --
> >> "Si quieres viajar alrededor del mundo y ser invitado a hablar en un
> >> monton de sitios diferentes, simplemente escribe un sistema operativo
> >> Unix."
> >>  Linus Tordvals, creador del sistema operativo Linux
> >
> >
>
>
>
> --
> "Si quieres viajar alrededor del mundo y ser invitado a hablar en un
> monton de sitios diferentes, simplemente escribe un sistema operativo
> Unix."
>  Linus Tordvals, creador del sistema operativo Linux
>
>
Received on Tuesday, 5 February 2013 22:39:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:57 GMT