This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12438 - Sync API for setVersion should specify a callback method and timeout value
Summary: Sync API for setVersion should specify a callback method and timeout value
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 17:38 UTC by Israel Hilerio [MSFT]
Modified: 2011-04-22 03:57 UTC (History)
4 users (show)

See Also:


Attachments

Description Israel Hilerio [MSFT] 2011-04-06 17:38:01 UTC
Issues:
IDBatabaseSync.setVersion assumes that the scope of the transaction it is working on is the code that follows the API.  The current approach introduces the possibility of deadlocks.  

In addition, there is no way to specify the timeout of the SET_VERSION transaction.

Solution:
Modify the existing setVersion API to include an IDBTransactionCallback parameter together with a timeout value parameter.

IDBTransactionSync setVersion ([TreatNullAs=EmptyString] in DOMString version, in IDBTransactionCallback callback, in optional unsigned long timeout);

Parameter #2:
* callback
Description
* Defines the method in which a VERSION_CHANGE transaction will be valid.

Parameter #3:
* timeout
Description
* Defines a transaction timeout value in milliseconds that will limit the lifetime of the VERSION_CHANGE transaction.  If the parameter is not provide, the timeout value will be infinite.
Comment 1 Israel Hilerio [MSFT] 2011-04-21 23:40:27 UTC
Need to add new exceptions for the setVersion and transction methods on IDBatabaseSync interface:

New setVersion Exception:
* The setVersion method needs to throw IDBDatabaseException with a NOT_ALLOWED_ERR description when the setVersion method is called within the IDBTransactionCallback of a transaction method.

New transaction Exception:
* The transaction method needs throw IDBDatabaseException  with a NOT_ALLOWED_ERR description when the transaction method is called within the IDBTransactionCallback of a setVersion method.
Comment 2 Eliot Graff 2011-04-22 03:57:04 UTC
The changes described above have been added to the speclets. They will be published at the next update to the Editor's Draft.

Thanks for the precise descriptions in the bug.

Eliot