W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

HTML 5 Database Storage Does Not Enable Chaining Transactions

From: Doug Reeder <dreeder5@columbus.rr.com>
Date: Sat, 4 Apr 2009 03:48:56 -0400
Message-Id: <CE9C573A-03E1-4EBC-B711-2BBD8DAEBDAB@columbus.rr.com>
To: public-webapps@w3.org
The scenario where I need to use HTML 5 Database storage requires  
storing a tree of data.   Each item has a unique id, generated by the  
database.   Child nodes have a "parentId" field which points to their  
parent ID.  Creating the records for a new tree in the database  
requires multiple transactions. First, the root item must be created.   
When the callback returns, the children of the root item can be  
created, because the id of the root item is now known.  For each  
child, when the appropriate callback returns, the children of the  
child can  be created, because their parent IDs are now known, and so  
forth.

Minimizing the number of transactions (and thus the overall time to  
create a database) requires there be multiple transactions outstanding  
at any given time.   Thus, when a callback function is called, it  
needs to determine _which_ transaction has completed.  The current  
version of the HTML 5 Database storage spec does not make this easy.  
It is straightforward for my app to generate a unique ID for each  
transaction, but the spec provides no way to pass this to the  
callbacks.  In JavaScript, I can add an "id" field to the transaction  
object, but then the _same_ id gets passed to each statement callback,  
and the transaction object is not passed _at all_ to the transaction  
success callback.

I'm sure there are other scenarios where it would be useful for a  
statement callback to know which statement has completed, and for a  
transaction callback to know which transaction has just completed.

Thank you.
Received on Thursday, 9 April 2009 09:34:47 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:31 GMT