Re: [IndexedDB] More questions about IDBRequests always firing (WAS: Reason for aborting transactions)

On Wed, Feb 16, 2011 at 8:40 PM, Jeremy Orlow <jorlow@chromium.org> wrote:
> On Wed, Feb 9, 2011 at 4:30 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>>
>> On Wed, Feb 9, 2011 at 4:03 PM, Jeremy Orlow <jorlow@chromium.org> wrote:
>> > Gotcha.  Does this mean that _every_ async request will fire an onerror
>> > or
>> > onsuccess?  I guess I had forgotten about that (and assumed it was that
>> > it'd
>> > fire either 0 or 1 times.)
>>
>> Yes. That's the idea. It's always nice to be able to rely on that
>> you'll *always* get one of the two callbacks. That way you can put
>> cleanup code in there and be sure that it always runs.
>
> Will the IDBRequest always fire before the IDBTransaction's abort/complete
> event fires?  (It seems like it should.)

I agree.

> Also, what should we do when you enqueue a setVersion transaction and then
> close the database handle?  Maybe an ABORT_ERR there too?

Yeah, that'd make sense to me. Just like if you enque any other
transaction and then close the db handle.

/ Jonas

Received on Thursday, 17 February 2011 07:39:39 UTC