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

[IndexedDB] Bug# 11401 - We should disallow .transaction() from within setVersion transactions

From: Israel Hilerio <israelh@microsoft.com>
Date: Tue, 17 May 2011 01:04:12 +0000
To: "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <F695AF7AA77CC745A271AD0F61BBC61E3D0B2D7C@TK5EX14MBXC119.redmond.corp.microsoft.com>
Pablo explained to me that the main issue with allowing transactions 
from being created inside a SetVersion handler is identifying which 
objectstores the new transaction is binding to. That is bug# 11401 [1].

Using Jeremy's example:
db.setVersion('1').onsuccess(function () {
   db.createObjectStore('a'); 	//objectstore a
   trans = db.transaction('a');
   db.createObjectStore('a'); 	//objecstore a'
   trans.objectStore('a').put('foo', 'bar'); });
It is unclear which of the two objectstores a or a' is associated with 
the newly created READ_ONLY transaction inside the setVersion handler.  
To echo Jeremy's proposal, would it be okay if we were not to support 
this scenario and just throw and exception.  

We would like to modify the spec to say something like:

Throws an IDBDatabaseException of NOT_ALLOWED_ERR when the
transaction() method is called within the onsuccess handler of a  
setVersion request.
[1] http://www.w3.org/Bugs/Public/show_bug.cgi?id=11401
Received on Tuesday, 17 May 2011 01:04:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:19 UTC