I've been having a bug where DOM IDBDatabase Exception 11 was being thrown out during my second migration.
Turned out the bug can be fixed by not waiting for transaction.oncomplete to fire next migration.
More specifically, transaction.oncomplete seems to be dependent upon the GC:
The following sentence isn't correct "Transactions today auto-commit when the transaction variable goes out of
scope and no more requests can be placed against it".
Since the JS GC sucks really bad, it's always a good idea to keep the transaction variable around if one wants to avoid an unfortunate oncomplete callback. (indeed calling this.transaction will fall out of the GC scope, thus transaction may be considered out of scope..)
I have thus added transaction as the first variable of the migration function. Also, it turned out that migrate was just a proxy for _migrate_next so I've removed _migrate_next.
Hi,
I've been having a bug where
DOM IDBDatabase Exception 11
was being thrown out during my second migration.Turned out the bug can be fixed by not waiting for
transaction.oncomplete
to fire next migration.More specifically,
transaction.oncomplete
seems to be dependent upon the GC:Since the JS GC sucks really bad, it's always a good idea to keep the transaction variable around if one wants to avoid an unfortunate
oncomplete
callback. (indeed callingthis.transaction
will fall out of the GC scope, thustransaction
may be considered out of scope..)I have thus added
transaction
as the first variable of the migration function. Also, it turned out thatmigrate
was just a proxy for_migrate_next
so I've removed_migrate_next
.