HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2958Introduce a Synchronous Database API for Workers.2009-04-02 23:54
@@ -51848,23 +51848,23 @@ have a variable and unknowable number of literals coming:
   names by mapping database names (e.g. using a hashing algorithm) to
   the supported set of names.</p>
 
   <p>If the database version provided is not the empty string, and the
   database already exists but has a different version, or no version,
   then the method must raise an <code>INVALID_STATE_ERR</code>
   exception.</p>
 
   <p>The version that the database was opened with is the <dfn
   title="concept-database-expected-version">expected version</dfn> of
-  this <code>Database</code> object. It can be the empty string, in
-  which case there is no expected version &mdash; any version is
-  fine.</p>
+  this <code>Database</code> or <code>DatabaseSync</code> object. It
+  can be the empty string, in which case there is no expected version
+  &mdash; any version is fine.</p>
 
   <p>Otherwise, if the database version provided is the empty string,
   or if the database doesn't yet exist, or if the database exists and
   the version requested is the same as the current version associated
   with the database, then the method must return an object
   representing the database that has the name that was given. If no
   such database exists, it must be created first.</p>
 
   <p>The user agent may raise a <code>SECURITY_ERR</code> exception
   instead of returning a <code>Database</code> object if the request
@@ -51914,38 +51914,86 @@ have a variable and unknowable number of literals coming:
     <p>The result is <var title="">the statement</var>.</p>
 
     <p class="XXX">Implementation feedback is requested on what
     to do with arguments that are of types that are not supported by
     the underlying SQL backend. For example, SQLite doesn't support
     booleans, so what should the UA do if passed a boolean? The Gears
     team suggests failing, not silently converting types.</p>
 
    </li>
 
-   <li><p>If the syntax of <var title="">sqlStatement</var> is not
-   valid (except for the use of <code title="">?</code> characters in
-   the place of literals), or the statement uses features that are not
-   supported (e.g. due to security reasons), or the number of items in
-   the <var title="">arguments</var> array is not equal to the number
-   of <code title="">?</code> placeholders in the statement, or the
-   statement cannot be parsed for some other reason, then mark <var title="">the
-   statement</var> as bogus.</p></li>
+   <li><p>If the <code>Database</code> object that the
+   <code>SQLTransaction</code> or <code>SQLTransactionSync</code>
+   object was created from has an <span
+   title="concept-database-expected-version">expected version</span>
+   that is neither the empty string nor the actual version of the
+   database, then mark <var title="">the statement</var> as
+   bogus. (<span title="dom-sqlerror-code-2">Error code
+   2</span>.)</p></li>
+
+   <li>
+
+    <p>Otherwise, if the syntax of <var title="">sqlStatement</var> is
+    not valid (except for the use of <code title="">?</code>
+    characters in the place of literals), or the statement uses
+    features that are not supported (e.g. due to security reasons), or
+    the number of items in the <var title="">arguments</var> array is
+    not equal to the number of <code title="">?</code> placeholders in
+    the statement, or the statement cannot be parsed for some other
+    reason, then mark <var title="">the statement</var> as
+    bogus. (<span title="dom-sqlerror-code-5">Error code
+    5</span>.)</p>
+
+    <p>User agents must consider statements that use the <code
+    title="">BEGIN</code>, <code title="">COMMIT</code>, and <code
+    title="">ROLLBACK</code> SQL features as being unsupported (and thus
+    will mark them as bogus), so as to not let these statements
+    interfere with the explicit transactions managed by the database API
+    itself.</p>
+
+   </li>
+
+   <li id="modifications-fail-if-read-only">
+
+    <p>Otherwise, if the <i>mode</i> that was used to create the
+    <code>SQLTransaction</code> or <code>SQLTransactionSync</code>
+    object is read-only but the statement's main verb can modify the
+    database, mark the statement as bogus. (<span
+    title="dom-sqlerror-code-5">Error code 5</span>.)</p>
+
+    <p class="note">Only the statement's main verb (e.g. <code
+    title="">UPDATE</code>, <code title="">SELECT</code>, <code
+    title="">DROP</code>) is considered here. Thus, a statement like
+    "<code title="">UPDATE test SET id=0 WHERE 0=1</code>" would be
+    treated as potentially modifying the database for the purposes
+    of this step, even though it could never in fact have any
+    side-effects.</p>
+
+   </li>
 
    <li><p>Return <var title="">the statement</var>.</p></li>
 
   </ol>
+
+  <p>The user agent must act as if the database was hosted in an
+  otherwise completely empty environment with no resources. For
+  example, attempts to read from or write to the file system will
+  fail.</p>
+
+  <p class="note">A future version of this specification will probably
+  define the exact SQL subset required in more detail.</p>
   
 
 
   <h5>Asynchronous database API</h5>
 
-  <pre class="idl">interface <dfn title="Database">Database</dfn> {
+  <pre class="idl">interface <dfn>Database</dfn> {
   void <span title="dom-database-transaction">transaction</span>(in <span>SQLTransactionCallback</span> callback, [Optional] in <span>SQLTransactionErrorCallback</span> errorCallback, [Optional] in <span>SQLVoidCallback</span> successCallback);
   void <span title="dom-database-readTransaction">readTransaction</span>(in <span>SQLTransactionCallback</span> callback, [Optional] in <span>SQLTransactionErrorCallback</span> errorCallback, [Optional] in <span>SQLVoidCallback</span> successCallback);
 
   readonly attribute DOMString <span title="dom-database-version">version</span>;
   void <span title="dom-database-changeVersion">changeVersion</span>(in DOMString oldVersion, in DOMString newVersion, in <span>SQLTransactionCallback</span> callback, in <span>SQLTransactionErrorCallback</span> errorCallback, in <span>SQLVoidCallback</span> successCallback);
 };
 
 [Callback=FunctionOnly, NoInterfaceObject]
 interface <dfn>SQLVoidCallback</dfn> {
   void <span title="dom-sqlvoidcallback-handleEvent">handleEvent</span>();
@@ -51958,21 +52006,21 @@ interface <dfn>SQLTransactionCallback</dfn> {
 
 [Callback=FunctionOnly, NoInterfaceObject]
 interface <dfn>SQLTransactionErrorCallback</dfn> {
   void <span title="dom-sqltransactionerrorcallback-handleEvent">handleEvent</span>(in <span>SQLError</span> error);
 };</pre>
 
   <p>The <dfn
   title="dom-database-transaction"><code>transaction()</code></dfn>
   and <dfn
   title="dom-database-readTransaction"><code>readTransaction()</code></dfn>
-  methods takes one to three arguments. When called, these method must
+  methods takes one to three arguments. When called, these methods must
   immediately return and then asynchronously run the <span>transaction
   steps</span> with the <i>transaction callback</i> being the first
   argument, the <i>error callback</i> being the second argument, if
   any, the <i>success callback</i> being the third argument, if any,
   and with no <i>preflight operation</i> or <i>postflight
   operation</i>.</p>
 
   <p>For the <code
   title="dom-database-transaction">transaction()</code> method, the
   <i>mode</i> must be read/write. For the <code
@@ -52019,21 +52067,22 @@ interface <dfn>SQLTransactionErrorCallback</dfn> {
    title="dom-database-changeVersion">changeVersion()</code>
    method.</li>
 
   </ol>
 
   <p>...and the <i>mode</i> being read/write.</p>
 
 
   <h6>Executing SQL statements</h6>
 
-  <p>The <code title="dom-database-transaction">transaction()</code>
+  <p>The <code title="dom-database-transaction">transaction()</code>,
+  <code title="dom-database-readTransaction">readTransaction()</code>,
   and <code title="dom-database-changeVersion">changeVersion()</code>
   methods invoke callbacks with <code>SQLTransaction</code>
   objects.</p>
 
   <pre class="idl">typedef sequence&lt;any> <dfn>ObjectArray</dfn>;
 
 interface <dfn>SQLTransaction</dfn> {
   void <span title="dom-sqltransaction-executeSql">executeSql</span>(in DOMString sqlStatement, [Optional] in <span>ObjectArray</span> arguments, [Optional] in <span>SQLStatementCallback</span> callback, [Optional] in <span>SQLStatementErrorCallback</span> errorCallback);
 };
 
@@ -52075,57 +52124,27 @@ interface <dfn>SQLStatementErrorCallback</dfn> {
     argument to the method (<var title="">sqlStatement</var>), using
     the second argument to the method as the <var
     title="">arguments</var> array, to obtain <var title="">the
     statement</var>.</p>
 
     <p>If the second argument is omitted or null, then treat the <var
     title="">arguments</var> array as empty.</p>
 
    </li>
 
-   <li><p>If the <code>Database</code> object that the
-   <code>SQLTransaction</code> object was created from has an <span
-   title="concept-database-expected-version">expected version</span>
-   that is neither the empty string nor the actual version of the
-   database, then mark <var title="">the statement</var> as
-   bogus. (<span title="dom-sqlerror-code-2">Error code
-   2</span>.)</p></li>
-
    <li><p>Queue up <var title="">the statement</var> in the
    transaction, along with the third argument (if any) as the
    statement's result set callback and the fourth argument (if any) as
    the error callback.</p></li>
 
   </ol>
 
-  <p>The user agent must act as if the database was hosted in an
-  otherwise completely empty environment with no resources. For
-  example, attempts to read from or write to the file system will
-  fail.</p>
-
-  <p>SQL inherently supports multiple concurrent connections. Authors
-  should make appropriate use of the transaction features to handle
-  the case of multiple scripts interacting with the same database
-  simultaneously (as could happen if the same page was opened in two
-  different <span title="browsing context">browsing
-  contexts</span>).</p>
-
-  <p>User agents must consider statements that use the <code
-  title="">BEGIN</code>, <code title="">COMMIT</code>, and <code
-  title="">ROLLBACK</code> SQL features as being unsupported (and thus
-  will mark them as bogus), so as to not let these statements
-  interfere with the explicit transactions managed by the database API
-  itself.</p>
-
-  <p class="note">A future version of this specification will probably
-  define the exact SQL subset required in more detail.</p>
-
 
 
   <h6>Processing model</h6>
 
   <p>The <dfn>transaction steps</dfn> are as follows. These steps must
   be run asynchronously. These steps are invoked with a <i>transaction
   callback</i>, optionally an <i>error callback</i>, optionally a
   <i>success callback</i>, optionally a <i>preflight operation</i>,
   optionally a <i>postflight operation</i>, and with a <i>mode</i>
   that is either read/write or read-only.</p>
@@ -52167,36 +52186,20 @@ interface <dfn>SQLStatementErrorCallback</dfn> {
    perform the following steps for each queued up statement in the
    transaction, oldest first. Each statement has a statement,
    optionally a result set callback, and optionally an error
    callback.</p>
 
     <ol>
 
      <li><p>If the statement is marked as bogus, jump to the "in case
      of error" steps below.</p></li>
 
-     <li id="modifications-fail-if-read-only">
-
-      <p>If the <i>mode</i> is read-only but the statement's main verb
-      can modify the database, jump to the "in case of error" steps
-      below.</p>
-
-      <p class="note">Only the statement's main verb (e.g. <code
-      title="">UPDATE</code>, <code title="">SELECT</code>, <code
-      title="">DROP</code>) is considered here. Thus, a statement like
-      "<code title="">UPDATE test SET id=0 WHERE 0=1</code>" would be
-      treated as potentially modifying the database for the purposes
-      of this step, even though it could never in fact have any
-      side-effects.</p>
-
-     </li>
-
      <li><p>Execute the statement in the context of the transaction.
      <a href="#refsSQL">[SQL]</a></p>
 
      <li><p>If the statement failed, jump to the "in case of error"
      steps below.</p></li>
 
      <li><p>Create a <code>SQLResultSet</code> object that represents
      the result of the statement.</p></li>
 
      <li><p>If the statement has a result set callback, <span>queue a
@@ -52260,26 +52263,210 @@ interface <dfn>SQLStatementErrorCallback</dfn> {
    callback</i> with a newly constructed <code>SQLError</code> object
    that represents the last error to have occurred in this
    transaction. Rollback the transaction. Any still-pending statements
    in the transaction are discarded.</p></li>
 
   </ol>
 
 
   <h5>Synchronous database API</h5>
 
-  <p class="XXX">...<dfn>DatabaseSync</dfn></p>
+  <pre class="idl">interface <dfn>DatabaseSync</dfn> {
+  <span>SQLTransactionSync</span> <span title="dom-database-sync-transaction">transaction</span>();
+  <span>SQLTransactionSync</span> <span title="dom-database-sync-readTransaction">readTransaction</span>();
+
+  readonly attribute DOMString <span title="dom-database-sync-version">version</span>;
+  <span>SQLTransactionSync</span> <span title="dom-database-sync-changeVersion">changeVersion</span>(in DOMString oldVersion, in DOMString newVersion);
+};</pre>
+
+  <p>The <dfn
+  title="dom-database-sync-transaction"><code>transaction()</code></dfn>
+  method must <span>create a <code>SQLTransactionSync</code>
+  object</span> for a read/write transaction, and return that
+  object.</p>
+
+  <p>The <dfn
+  title="dom-database-sync-readTransaction"><code>readTransaction()</code></dfn>
+  method must <span>create a <code>SQLTransactionSync</code>
+  object</span> for a read/only transaction, and return that
+  object.</p>
+
+  <p>On getting, the <dfn
+  title="dom-database-sync-version"><code>version</code></dfn>
+  attribute must return the current version of the database (as
+  opposed to the <span
+  title="concept-database-expected-version">expected version</span> of
+  the <code>DatabaseSync</code> object).</p>
+
+  <p>The <dfn
+  title="dom-database-sync-changeVersion"><code>changeVersion()</code></dfn>
+  method allows scripts to atomically verify the version number and
+  change it at the same time as doing a schema update. When the method
+  is invoked, it must run the following steps:</p>
+
+  <ol>
+
+   <li><p><span>Create a <code>SQLTransactionSync</code> object</span>
+   for a read/write transaction. If this throws an exception, then
+   rethrow it and abort these steps.</p></li>
+
+   <li><p>Check that the value of the first argument to the <code
+   title="dom-database-sync-changeVersion">changeVersion()</code>
+   method exactly matches the database's actual version. If it does
+   not, then throw a <code>SQLTransactionSync</code> object and abort
+   these steps. (<span title="dom-sqlerror-code-2">Error code
+   2</span>.)</p></li>
+
+   <li><p>Return the <code>SQLTransactionSync</code> object.</p></li>
+
+  </ol>
+
+  <p>When the <code>SQLTransactionSync</code> object's <code
+  title="dom-sqltransaction-sync-commit">commit()</code> method is
+  invoked, when the steps for that method invoke the <i>postcommit
+  operation</i>, the user agent must run the following steps:</p>
+
+  <ol>
+
+   <li>Change the database's actual version to the value of the second
+   argument to the <code
+   title="dom-database-sync-changeVersion">changeVersion()</code>
+   method.</li>
+
+   <li>Change the <code>Database</code> object's expected version to
+   the value of the second argument to the <code
+   title="dom-database-sync-changeVersion">changeVersion()</code>
+   method.</li>
+
+  </ol>
+
+  <hr>
+
+  <p>When the user agent is to <dfn>create a
+  <code>SQLTransactionSync</code> object</dfn> for a transaction that
+  is either read/write or read-only, it must run the following
+  steps:</p>
+
+  <ol>
+
+   <li><p>Open a new SQL transaction to the database, and create a
+   <code>SQLTransactionSync</code> object that represents that
+   transaction. If the <i>mode</i> is read/write, the transaction must
+   have an exclusive write lock over the entire database. If the
+   <i>mode</i> is read-only, the transaction must have a shared read
+   lock over the entire database. The user agent should wait for an
+   appropriate lock to be available.</p></li>
+
+   <li><p>If an error occurred in the opening of the transaction
+   (e.g. if the user agent failed to obtain an appropriate lock after
+   an appropriate delay), throw a <code>SQLException</code> exception
+   and abort these steps.</p></li>
+
+   <li><p>Return the newly created <code>SQLTransactionSync</code>
+   object.</p></li>
+
+  </ol>
+
+
+
+  <h6>Executing SQL statements</h6>
+
+  <p>The <code
+  title="dom-database-sync-transaction">transaction()</code>, <code
+  title="dom-database-sync-readTransaction">readTransaction()</code>,
+  and <code
+  title="dom-database-sync-changeVersion">changeVersion()</code>
+  methods return <code>SQLTransactionSync</code> objects.</p>
+
+  <pre class="idl">// typedef sequence&lt;any> <span>ObjectArray</span>;
+
+interface <dfn>SQLTransactionSync</dfn> {
+  <span>SQLResultSet</span> <span title="dom-sqltransaction-sync-executeSql">executeSql</span>(in DOMString sqlStatement, [Optional] in <span>ObjectArray</span> arguments);
+  void <span title="dom-sqltransaction-sync-commit">commit</span>();
+};</pre>
+
+  <p>A <code>SQLTransactionSync</code> object is initially <i
+  title="">fresh</i>, but it will be marked as <i title="">stale</i>
+  once it has been committed or rolled back.</p>
+
+  <p>When the <dfn
+  title="dom-sqltransaction-sync-executeSql"><code>executeSql(<var
+  title="">sqlStatement</var>, <var
+  title="">arguments</var>)</code></dfn> method is invoked, the user
+  agent must run the following algorithm:</p>
+
+  <ol>
+
+   <li><p>If the <code>SQLTransactionSync</code> object is <i
+   title="">stale</i>, then throw an <code>INVALID_STATE_ERR</code>
+   exception.</p></li>
+
+   <li>
+
+    <p><span>Preprocess the SQL statement</span> given as the first
+    argument to the method (<var title="">sqlStatement</var>), using
+    the second argument to the method as the <var
+    title="">arguments</var> array, to obtain <var title="">the
+    statement</var>.</p>
+
+    <p>If the second argument is omitted or null, then treat the <var
+    title="">arguments</var> array as empty.</p>
+
+   </li>
+
+   <li><p>If the statement is marked as bogus, throw a
+   <code>SQLException</code> exception.</p></li>
+
+   <li><p>Execute the statement in the context of the transaction.
+   <a href="#refsSQL">[SQL]</a></p>
+
+   <li><p>If the statement failed, throw a <code>SQLException</code>
+   exception.</p></li>
+
+   <li><p>Create a <code>SQLResultSet</code> object that represents
+   the result of the statement.</p></li>
+
+   <li><p>Return the newly created <code>SQLResultSet</code>
+   object.</p></li>
+
+  </ol>
+
+  <hr>
+
+  <p>When the <dfn
+  title="dom-sqltransaction-sync-commit"><code>commit()</code></dfn>
+  method is invoked, the user agent must run the following
+  algorithm:</p>
+
+  <ol>
+
+   <li><p>Commit the transaction.</p></li>
+
+   <li><p>Mark the <code>SQLTransactionSync</code> object as <i
+   title="">stale</i>.</p>
+
+   <li><p>If appropriate (i.e. if the <code
+   title="dom-database-sync-changeVersion">changeVersion()</code>
+   method created the <code>SQLTransactionSync</code> object), invoke
+   the <i>postcommit operation</i>.</p>
+
+   <li><p>If an error occurred in the committing of the transaction,
+   throw a <code>SQLException</code> exception.</p></li>
+
+  </ol>
+
+
 
 
   <h5>Database query results</h5>
 
-  <p>The <code title="dom-transaction-executeSql">executeSql()</code>
+  <p>The <code title="dom-sqltransaction-executeSql">executeSql()</code>
   method invokes its callback with a <code>SQLResultSet</code> object
   as an argument.</p>
 
   <pre class="idl">interface <dfn>SQLResultSet</dfn> {
   readonly attribute long <span title="dom-SQLResultSet-insertId">insertId</span>;
   readonly attribute long <span title="dom-SQLResultSet-rowsAffected">rowsAffected</span>;
   readonly attribute <span>SQLResultSetRowList</span> <span title="dom-SQLResultSet-rows">rows</span>;
 };</pre>
 
   <p>The <dfn
@@ -52331,97 +52518,133 @@ interface <dfn>SQLStatementErrorCallback</dfn> {
 
   <p>Each row must be represented by a native ordered dictionary data
   type. In the JavaScript binding, this must be <code>Object</code>.
   Each row object must have one property (or dictionary entry) per
   column, with those properties enumerating in the order that these
   columns were returned by the database. Each property must have the
   name of the column and the value of the cell, as they were returned
   by the database.</p>
 
 
-  <h5>Errors</h5>
+  <h5>Errors and exceptions</h5>
 
-  <p>Errors in the database API are reported using callbacks that have
-  a <code>SQLError</code> object as one of their arguments.</p>
+  <p>Errors in the asynchronous database API are reported using
+  callbacks that have a <code>SQLError</code> object as one of their
+  arguments.</p>
 
   <pre class="idl">interface <dfn>SQLError</dfn> {
   readonly attribute unsigned long <span title="dom-SQLError-code">code</span>;
   readonly attribute DOMString <span title="dom-SQLError-message">message</span>;
 };</pre>
 
+  <p>The <dfn title="dom-SQLError-code"><code>code</code></dfn> DOM
+  attribute must return the most appropriate code from the table
+  below.</p>
+
+  <p>The <dfn title="dom-SQLError-message"><code>message</code></dfn>
+  DOM attribute must return an error message describing the error
+  encountered. The message should be localized to the user's
+  language.</p>
+
+  <hr>
+
+  <p>Errors in the synchronous database API are reported using
+  exceptions that implement the <code>SQLException</code>
+  interface:</p>
+
+  <pre class="idl">exception <dfn>SQLException</dfn> {
+  readonly attribute unsigned long <span title="dom-SQLException-code">code</span>;
+  readonly attribute DOMString <span title="dom-SQLException-message">message</span>;
+};</pre>
+
+  <p>The <dfn title="dom-SQLException-code"><code>code</code></dfn>
+  DOM attribute must return the most appropriate code from the table
+  below.</p>
+
   <p>The <dfn
-  title="dom-SQLError-code"><code>code</code></dfn> DOM
-  attribute must return the most appropriate code from the following
-  table:</p>
+  title="dom-SQLException-message"><code>message</code></dfn> DOM
+  attribute must return an error message describing the error
+  encountered. The message should be localized to the user's
+  language.</p>
+
+  <hr>
+
+  <p>The error codes are as follows:</p>
 
   <table>
    <thead>
     <tr>
      <th>Code
      <th>Situation
    <tbody>
 
     <tr>
      <td><dfn title="dom-sqlerror-code-0">0</dfn>
      <td>The transaction failed for reasons unrelated to the database
      itself and not covered by any other error code.
 
     <tr>
      <td><dfn title="dom-sqlerror-code-1">1</dfn>
      <td>The statement failed for database reasons not covered by any
      other error code.
 
     <tr>
      <td><dfn title="dom-sqlerror-code-2">2</dfn>
-     <td>The statement failed because the <span
+     <td>The operation failed because the actual database version was
+     not what it should be. For example, a statement found that the
+     actual database version no longer matched the <span
      title="concept-database-expected-version">expected version</span>
-     of the database didn't match the actual database version.
+     of the <code>Database</code> or <code>DatabaseSync</code> object,
+     or the <code
+     title="dom-database-changeversion">Database.changeVersion()</code>
+     or <code
+     title="dom-database-sync-changeversion">DatabaseSync.changeVersion()</code>
+     methods were passed a version that doesn't match the actual
+     database version.
 
     <tr>
      <td><dfn title="dom-sqlerror-code-3">3</dfn>
      <td>The statement failed because the data returned from the
      database was too large. The SQL "LIMIT" modifier might be useful
      to reduce the size of the result set.
 
     <tr>
      <td><dfn title="dom-sqlerror-code-4">4</dfn>
      <td>The statement failed because there was not enough remaining
      storage space, or the storage quota was reached and the user
      declined to give more space to the database.
 
     <tr>
      <td><dfn title="dom-sqlerror-code-5">5</dfn>
-     <td>The statement failed because the transaction's first
-     statement was a read-only statement, and a subsequent statement
-     in the same transaction tried to modify the database, but the
-     transaction failed to obtain a write lock before another
-     transaction obtained a write lock and changed a part of the
-     database that the former transaction was depending upon.
+     <td>The statement failed because of a syntax error, or the number
+     of arguments did not match the number of <code title="">?</code>
+     placeholders in the statement, or the statement tried to use a
+     statement that is not allowed, such as <code
+     title="">BEGIN</code>, <code title="">COMMIT</code>, or <code
+     title="">ROLLBACK</code>, or the statement tried to use a verb
+     that could modify the database but the transaction was read-only.
 
     <tr>
      <td><dfn title="dom-sqlerror-code-6">6</dfn>
      <td>An <code title="">INSERT</code>, <code
      title="">UPDATE</code>, or <code title="">REPLACE</code>
      statement failed due to a constraint failure. For example,
      because a row was being inserted and the value given for the
      primary key column duplicated the value of an existing row.
 
-  </table>
+    <tr>
+     <td><dfn title="dom-sqlerror-code-7">7</dfn>
+     <td>A lock for the transaction could not be obtained in a
+     reasonable time.
 
-  <p class="XXX">We should define a more thorough list of
-  codes. Implementation feedback is requested to determine what codes
-  are needed.</p>
+  </table>
 
-  <p>The <dfn title="dom-SQLError-message"><code>message</code></dfn>
-  DOM attribute must return an error message describing the error
-  encountered. The message should be localized to the user's
-  language.</p>
 
 
   <h4>Disk space</h4>
 
   <p>User agents should limit the total amount of space allowed for
   storage areas and databases.</p>
 
   <p>User agents should guard against sites storing data in the
   storage areas or databases of subdomains, e.g. storing up to the
   limit in a1.example.com, a2.example.com, a3.example.com, etc,

|