From 5d1070bce4dec31900725b75283af0ef9f50a49a Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Tue, 7 Mar 2017 10:08:49 -0800 Subject: [PATCH] Activate/deactivate transactions in upgradeneeded. For #163 --- index.bs | 6 ++++-- index.html | 18 +++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/index.bs b/index.bs index 062e78d..eda619c 100644 --- a/index.bs +++ b/index.bs @@ -5480,11 +5480,13 @@ for the [=database=], and a |request|. 1. Set |request|'s [=request/result=] to |connection|. 2. Set |request|'s [=request/transaction=] to |transaction|. 3. Set the [=request/done flag=] on the [=request=]. - 4. Let |didThrow| be the result of running the steps to + 4. Set |transaction|'s [=transaction/active flag=]. + 5. Let |didThrow| be the result of running the steps to [=fire a version change event=] named [=upgradeneeded=] at |request| with |old version| and |version|. - 5. If |didThrow| is set, run the steps to [=abort a + 6. Unset |transaction|'s [=transaction/active flag=]. + 7. If |didThrow| is set, run the steps to [=abort a transaction=] with the |error| property set to a newly created "{{AbortError}}" {{DOMException}}. diff --git a/index.html b/index.html index 0f001b9..3a21f15 100644 --- a/index.html +++ b/index.html @@ -5380,9 +5380,13 @@

Set request’s transaction to transaction.

  • Set the done flag on the request.

    +
  • +

    Set transaction’s active flag.

  • Let didThrow be the result of running the steps to fire a version change event named upgradeneeded at request with old version and version.

    +
  • +

    Unset transaction’s active flag.

  • If didThrow is set, run the steps to abort a transaction with the error property set to a newly created "AbortError" DOMException.

    @@ -5469,11 +5473,11 @@

    Let legacyOutputDidListenersThrowFlag be initially unset.

  • -

    Set transaction’s active flag.

    +

    Set transaction’s active flag.

  • Dispatch event at request with legacyOutputDidListenersThrowFlag.

  • -

    Unset transaction’s active flag.

    +

    Unset transaction’s active flag.

  • If legacyOutputDidListenersThrowFlag is set, run the steps to abort a transaction with transaction and a newly created "AbortError" DOMException.

    @@ -5495,11 +5499,11 @@

    Let legacyOutputDidListenersThrowFlag be initially unset.

  • -

    Set transaction’s active flag.

    +

    Set transaction’s active flag.

  • Dispatch event at request with legacyOutputDidListenersThrowFlag.

  • -

    Unset transaction’s active flag.

    +

    Unset transaction’s active flag.

  • If legacyOutputDidListenersThrowFlag is set, run the steps to abort a transaction with transaction and a newly created "AbortError" DOMException and terminate these steps. This is done even if the @@ -7999,9 +8003,9 @@

    I
  • 2.7. Transactions (2)
  • 2.7.1. Transaction Lifetime (2)
  • 4.9. The IDBTransaction interface -
  • 5.7. Running an upgrade transaction -
  • 5.9. Firing a success event (2) -
  • 5.10. Firing an error event (2) +
  • 5.7. Running an upgrade transaction (2) (3) +
  • 5.9. Firing a success event (2) +
  • 5.10. Firing an error event (2)