Re: [IndexedDB] Interaction between transactions and objects that allow multiple operations

On Wed, May 5, 2010 at 7:02 PM, Shawn Wilsher <sdwilsh@mozilla.com> wrote:

> On 5/4/2010 7:17 PM, Pablo Castro wrote:
>
>> c) require an explicit transaction always, along the lines Nikunj's
>> original proposal had it. We would move most methods from database to
>> transaction (except a few properties such as version and such, which it may
>> still be ok to handle implicitly from the transactions perspective). This
>> eliminates this whole problem altogether at the cost of an extra step
>> required always.
>>
> I'm rather loath about adding more asynchronous steps to do even the most
> simplest of tasks here.  What about only doing this for cursor operations
> only?  Basically, openCursor would be on the transaction object instead of
> on the database object.
>

On the other hand, a lot of even the most basic tasks probably should be
done within a transaction.  But if the easiest way to do something is to
just run it outside of a transaction, I'm guessing a good portion of users
(including tutorial websites, people giving advice on forums, etc) will just
do it that way.  Mandating transactions forces users to be cognizant of
them.  Maybe that's a good thing...

J

Received on Wednesday, 5 May 2010 18:45:41 UTC