@@ -880,6 +880,17 @@ A <a for=/>transaction</a> has a <dfn>error</dfn> which is set if the
880
880
A <a for=/>transaction</a> 's <a>get the parent</a> algorithm returns the
881
881
transaction's <a for=transaction>connection</a> .
882
882
883
+ A <dfn>read-only transaction</dfn> is
884
+ a <a for=/>transaction</a> with <a>mode</a> {{"readonly"}} .
885
+
886
+ A <dfn>read/write transaction</dfn>
887
+ is a <a for=/>transaction</a> with <a>mode</a> {{"readwrite"}} .
888
+
889
+
890
+ <!-- ============================================================ -->
891
+ <h4 id=transaction-lifetime-concept>Transaction Lifetime</h4>
892
+ <!-- ============================================================ -->
893
+
883
894
Transactions are expected to be short lived. This is encouraged by the
884
895
<a for=transaction lt=commit>automatic committing</a> functionality
885
896
described below.
@@ -944,9 +955,10 @@ The <dfn>lifetime</dfn> of a
944
955
if an IO error happened, {{UnknownError}} should be used as
945
956
|error|.
946
957
947
- 7. When a transaction can no longer become <a>active</a> , the
948
- implementation must attempt to <dfn lt="commit|committing|committed">commit</dfn> it, as long as the transaction has not been
949
- <a>aborted</a> . This usually happens
958
+ 7. When a transaction has been started and it can no longer become
959
+ <a>active</a> , the implementation must attempt to <dfn
960
+ lt="commit|committing|committed"> commit</dfn> it, as long as the
961
+ transaction has not been <a>aborted</a> . This usually happens
950
962
after all requests placed against the transaction have been
951
963
executed and their returned results handled, and no new requests
952
964
have been placed against the transaction. When a transaction is
@@ -955,10 +967,11 @@ The <dfn>lifetime</dfn> of a
955
967
transaction. That is, either all of the changes must be written,
956
968
or if an error occurs, such as a disk write error, the
957
969
implementation must not write any of the changes to the database.
958
- If such an error occurs, the implementation must <a>abort</a> the transaction by following
959
- the <a>steps for aborting a transaction</a> , otherwise it must <a
960
- for=transaction> commit</a> the transaction by
961
- following the <a>steps for committing a transaction</a> .
970
+ If such an error occurs, the implementation must <a>abort</a> the
971
+ transaction by following the <a>steps for aborting a
972
+ transaction</a> , otherwise it must <a for=transaction>commit</a>
973
+ the transaction by following the <a>steps for committing a
974
+ transaction</a> .
962
975
963
976
8. When a transaction is <a for=transaction>committed</a>
964
977
or <a>aborted</a> , it is said to be
@@ -968,12 +981,6 @@ The <dfn>lifetime</dfn> of a
968
981
implementation must <a>abort</a> the
969
982
transaction.
970
983
971
- A <dfn>read-only transaction</dfn> is
972
- a <a for=/>transaction</a> with <a>mode</a> {{"readonly"}} .
973
-
974
- A <dfn>read/write transaction</dfn>
975
- is a <a for=/>transaction</a> with <a>mode</a> {{"readwrite"}} .
976
-
977
984
The following constraints define when a <a for=/>transaction</a> can be <a>started</a> :
978
985
979
986
* Any number of <a>read-only transactions</a> are allowed to run
@@ -5913,6 +5920,8 @@ document's Revision History</a>.
5913
5920
* Added {{IDBObjectStore/getKey()}} on {{IDBObjectStore}} .
5914
5921
(<a href="https://github.com/w3c/IndexedDB/issues/26">bug #26</a> )
5915
5922
5923
+ * Clarified when a transaction can attempt to commit.
5924
+ (<a href="https://github.com/w3c/IndexedDB/issues/77">bug #77</a> )
5916
5925
5917
5926
<!-- ============================================================ -->
5918
5927
<h2 id=acknowledgements>Acknowledgements</h2>
0 commit comments