Closed Bug 700544 Opened 12 years ago Closed 12 years ago

IndexedDB: Start a transaction when created, not when first request is placed

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sicking, Assigned: khuey)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

I.e. given the following code:

var trans1 = db.transaction("foo", READ_WRITE);
var trans2 = db.transaction("foo", READ_WRITE);
trans2.put("2", "key");
trans1.put("1", "key");

The objectStore should after the two transactions commit contain the value "2" since trans2 should run after trans1.
Assignee: nobody → khuey
Attached patch PatchSplinter Review
I slipped some cleanup in TransactionThreadPool in here too.
Attachment #574376 - Flags: review?(bent.mozilla)
Comment on attachment 574376 [details] [diff] [review]
Patch

Review of attachment 574376 [details] [diff] [review]:
-----------------------------------------------------------------

Ha, you tricked me.

::: dom/indexedDB/IDBTransaction.cpp
@@ +99,5 @@
> +}
> +
> +NS_IMPL_QUERY_INTERFACE1(StartTransactionRunnable, nsIRunnable)
> +
> +StartTransactionRunnable kDummyRunnable;

Nit: Let's call this gStartTransactionRunnable.
Attachment #574376 - Flags: review?(bent.mozilla) → review+
(In reply to ben turner [:bent] from comment #2)
> Comment on attachment 574376 [details] [diff] [review] [diff] [details] [review]
> Patch
> 
> Review of attachment 574376 [details] [diff] [review] [diff] [details] [review]:
> -----------------------------------------------------------------
> 
> Ha, you tricked me.

Indeed.

> ::: dom/indexedDB/IDBTransaction.cpp
> @@ +99,5 @@
> > +}
> > +
> > +NS_IMPL_QUERY_INTERFACE1(StartTransactionRunnable, nsIRunnable)
> > +
> > +StartTransactionRunnable kDummyRunnable;
> 
> Nit: Let's call this gStartTransactionRunnable.

Done.
https://hg.mozilla.org/mozilla-central/rev/ca8665b874d8
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
Depends on: 714627
Component: DOM → DOM: IndexedDB
Target Milestone: mozilla11 → ---
Version: Trunk → unspecified
Killing some old dev-doc-needed bugs ;-)

I've now documented this, adding a note in both the Transaction interface page, and the release notes for Firefox 11...

https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction
https://developer.mozilla.org/en-US/Firefox/Releases/11#IndexedDB
You need to log in before you can comment on or make changes to this bug.