- From: Kyaw Tun <kyawtun@yathit.com>
- Date: Thu, 16 May 2013 12:44:04 +0800
- To: Jonas Sicking <jonas@sicking.cc>
- Cc: Webapps WG <public-webapps@w3.org>
- Message-ID: <CAFPCW96XRDMFJFpxXKFo+yeC6h1BDKp6WWZ5_JtsdSGZMbYfPw@mail.gmail.com>
Oh yes, it works great. What a nice twist! I learned IndexedDB for one year (literally), still not get it. On Thu, May 16, 2013 at 12:03 PM, Jonas Sicking <jonas@sicking.cc> wrote: > On Wed, May 15, 2013 at 7:45 PM, Kyaw Tun <kyawtun@yathit.com> wrote: > > When ConstraintError occur in 'steps for storing a record into an object > > store', it said 'Abort this algorithm without taking any further steps.' > I > > assume the transaction can be still be used, except that this request > fail. > > However both Chrome and Firefox implementation abort transaction. Is that > > correct behavior? > > The steps run by, for example, objectStore.add is actually "steps for > asynchronously executing a request". > > This is the algorithm that eventually ends up running the "steps for > storing a record into an object store". > > The in step 7 of the "steps for asynchronously executing a request", > if the database operation failed we run the "fire an error event" > algorithm. > > When this algorithm runs, unless the error Event is cancelled through > Event.preventDefault(), the transaction is aborted. > > So the transaction isn't always aborted. But it is aborted if the > error goes unhandled which sounds like is the case for you. > > / Jonas >
Received on Thursday, 16 May 2013 04:44:36 UTC