Closed Bug 384732 Opened 18 years ago Closed 18 years ago

Download manager should use a transaction when importing from downloads.rdf

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha6

People

(Reporter: sdwilsh, Assigned: Mardak)

Details

Attachments

(1 file, 3 obsolete files)

We should start a transaction right before we start importing downloads to speed things up (especially with larger downloads.rdf). This will involve adding one line before this bit http://mxr.mozilla.org/seamonkey/source/toolkit/components/downloads/src/nsDownloadManager.cpp#263 mozStorageTransaction(mDBConn, PR_TRUE); and of course, #include "mozStorageHelper.h" somewhere up top :)
Attached patch v1 (obsolete) — Splinter Review
(void) the mozStorageTransaction return value from mozStorageTransaction's constructor (void) the PRInt64 return value from AddDownloadToDB
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #268659 - Flags: review?(sdwilsh)
Attached patch v2 (obsolete) — Splinter Review
on second though, a constructor has no return value.. there's no return statements..... (However, I suppose a new <class> would have a return type of <class>.)
Attachment #268659 - Attachment is obsolete: true
Attachment #268660 - Flags: review?(sdwilsh)
Attachment #268659 - Flags: review?(sdwilsh)
Comment on attachment 268660 [details] [diff] [review] v2 >+ // Use a transaction to speed up INSERTs if we happen to be adding >+ // a lot of downloads - commits the transaction when destructing. nit: lose the comment - it is what the function is for.
Attachment #268660 - Flags: review?(sdwilsh) → review+
Attached patch v3 (obsolete) — Splinter Review
(In reply to comment #3) > >+ // Use a transaction to speed up INSERTs if we happen to be adding > >+ // a lot of downloads - commits the transaction when destructing. > nit: lose the comment - it is what the function is for. gone
Attachment #268660 - Attachment is obsolete: true
Attachment #268662 - Flags: review+
Whiteboard: [checkin needed]
actually - does this even compile? It should be something like: mozStorageTransaction transaction(mDBConn, PR_TRUE); Sorry for the confusing initial comment....
Whiteboard: [checkin needed]
It compiles. I looked through other code and they do something similar. That's why I originally put the comments about how the constructor/destructor works. Without a name, it'll still construct a mozStorageTransaction object for the scope and it'll destruct at the end of the method.
Attached patch v4Splinter Review
Oops, it /does/ compile but apparently without a name, it constructs and destructs on that same line.
Attachment #268662 - Attachment is obsolete: true
Attachment #268841 - Flags: review+
Checking in toolkit/components/downloads/src/nsDownloadManager.cpp; new revision: 1.90; previous revision: 1.89
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3 alpha6
Flags: in-testsuite-
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: