This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In the TPAC folks proposed to tweak the sync API such that it prevents code patterns that cause deadlocks at the start of a transaction. We ended up with a proposal where we'd add a callback to IDBDatabaseSync.transaction, and work in that transaction can only happen within the callback. The change would be: - add a callback argument to IDBDatabaseSync.transaction(), the callback will receive one argument that's the transaction object - once the callback returns, the transaction is committed - if an exception is thrown and not caught inside the callback then the transaction must be aborted - make the method void, no transaction object is returned - a call to transaction() from within a transaction callback or an async API callback that involves a transaction will fail with NOT_ALLOWED_ERR.
It's worth making clear that the callback will be called synchronously. (i.e. no code after the transaction call will execute until after the callback executes (if it'll ever execute). The callback is just to make the scope of the transaction more explicit.