[html5] r1035 - /

whatwg at whatwg.org whatwg at whatwg.org
Tue Sep 25 02:22:35 PDT 2007


Author: ianh
Date: 2007-09-25 02:22:34 -0700 (Tue, 25 Sep 2007)
New Revision: 1035

Modified:
   index
   source
Log:
[] (0) Change the way that changing a database version works.

Modified: index
===================================================================
--- index	2007-09-25 08:57:17 UTC (rev 1034)
+++ index	2007-09-25 09:22:34 UTC (rev 1035)
@@ -28502,7 +28502,8 @@
    fine.
 
   <pre class=idl>interface <dfn id=database0>Database</dfn> {
-           attribute DOMString <a href="#version" title=dom-database-version>version</a>;
+  readonly attribute DOMString <a href="#version" title=dom-database-version>version</a>;
+  bool <a href="#changeversion" title=dom-database-changeVersion>changeVersion</a>(in DOMString oldVersion, in DOMString newVersion);
   void <a href="#executesql" title=dom-database-executeSql>executeSql</a>(in DOMString sqlStatement, <var title="">arguments...</var>, in <a href="#sqlcallback">SQLCallback</a> callback);<!--
   void <span title="dom-database-executeSql">executeSql</span>(in Array sqlStatements, in <span>SQLCallback</span> callback); // XXX add this in v2 -->
   void <a href="#closetransaction" title=dom-database-closeTransaction>closeTransaction</a>(); // only needed as part of error recovery
@@ -28520,12 +28521,22 @@
   <p>On getting, the attribute must return the current version of the
    database.
 
-  <p>On setting, the attribute must wait for all transactions that are trying
-   to commit to finish commiting, and then must change the current version of
-   the database and the <a href="#expected"
-   title=concept-database-expected-version>expected version</a> of the
-   <code><a href="#database0">Database</a></code> object on which the
-   attribute was called to the new value.
+  <p>The <dfn id=changeversion
+   title=dom-database-changeVersion>changeVersion()</dfn> method allows you
+   to atomically verify the version number and change it. When the method is
+   invoked, the user agent must obtain a full lock of the database (waiting
+   for all open transactions to be closed), and then must verify that the
+   current version of the database matches the first argument to the method.
+   If it does not match, then the user agent must release the lock and return
+   false. Otherwise, the current version matches the first argument, and the
+   user agent must change the current version of the database and the <a
+   href="#expected" title=concept-database-expected-version>expected
+   version</a> of the <code><a href="#database0">Database</a></code> object
+   on which the method was invoked to the value of the second argument. Then,
+   the lock must be released. Any <code><a
+   href="#database0">Database</a></code> instances that have an expected
+   version that differs from the new version will start failing at this
+   point. Finally, the method must return true.
 
   <h4 id=executing><span class=secno>4.10.3. </span>Executing SQL statements</h4>
 

Modified: source
===================================================================
--- source	2007-09-25 08:57:17 UTC (rev 1034)
+++ source	2007-09-25 09:22:34 UTC (rev 1035)
@@ -26085,7 +26085,8 @@
   fine.</p>
 
   <pre class="idl">interface <dfn>Database</dfn> {
-           attribute DOMString <span title="dom-database-version">version</span>;
+  readonly attribute DOMString <span title="dom-database-version">version</span>;
+  bool <span title="dom-database-changeVersion">changeVersion</span>(in DOMString oldVersion, in DOMString newVersion);
   void <span title="dom-database-executeSql">executeSql</span>(in DOMString sqlStatement, <var title="">arguments...</var>, in <span>SQLCallback</span> callback);<!--
   void <span title="dom-database-executeSql">executeSql</span>(in Array sqlStatements, in <span>SQLCallback</span> callback); // XXX add this in v2 -->
   void <span title="dom-database-closeTransaction">closeTransaction</span>(); // only needed as part of error recovery
@@ -26103,12 +26104,22 @@
   <p>On getting, the attribute must return the current version of the
   database.</p>
 
-  <p>On setting, the attribute must wait for all transactions that are
-  trying to commit to finish commiting, and then must change the
-  current version of the database and the <span
-  title="concept-database-expected-version">expected version</span> of
-  the <code>Database</code> object on which the attribute was called
-  to the new value.</p>
+  <p>The <dfn
+  title="dom-database-changeVersion">changeVersion()</span></dfn>
+  method allows you to atomically verify the version number and change
+  it. When the method is invoked, the user agent must obtain a full
+  lock of the database (waiting for all open transactions to be
+  closed), and then must verify that the current version of the
+  database matches the first argument to the method. If it does not
+  match, then the user agent must release the lock and return
+  false. Otherwise, the current version matches the first argument,
+  and the user agent must change the current version of the database
+  and the <span title="concept-database-expected-version">expected
+  version</span> of the <code>Database</code> object on which the
+  method was invoked to the value of the second argument. Then, the
+  lock must be released. Any <code>Database</code> instances that have
+  an expected version that differs from the new version will start
+  failing at this point. Finally, the method must return true.</p>
 
 
 




More information about the Commit-Watchers mailing list