Does IndexedDb have the equivalent of a transaction.completing event? -
is there way know when requests have finished before transaction commits? transaction.oncomplete
event not allow additional logic run while still calling transaction.abort()
. so, better way use equivalent of transaction.completing
(i made up) fire after requests complete still allow transaction.abort()
called.
http://www.w3.org/tr/indexeddb/
in general, should considered practice. in common case simple syntax errors not leave database in inconsistent case.
is there way know when requests have finished before transaction commits?
yes have write code listens operations' success
or error
events. there no beforecommit
event like. feel free make case inclusion on public-webapps.
in common case simple syntax errors not leave database in inconsistent case.
how can database inconsistent state? that's why error
event exists , default causes transaction abort. see http://w3c.github.io/indexeddb/#dfn-fire-an-error-event.
Comments
Post a Comment