Re: [IndexedDB] Does "Abort this algorithm" mean "Abort transaction"?

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:04:53 UTC