Closed Bug 374016 Opened 18 years ago Closed 18 years ago

Use transactions to create bugs

Categories

(Bugzilla :: Database, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

This is a lot easier than for process_bug.cgi. We need the transactions to happen inside of Bugzilla::Bug (for things like XML-RPC) and also in post_bug (for normal web bug-entry).
Attached patch v1 (obsolete) — Splinter Review
Okay. I've tested this, it seems to work just fine. I actually don't think we even really need to lock longdescs--what possible race condition could occur on that table there (other than having a rollback and leaving a comment in the table with an invalid bug ID).
Assignee: database → mkanat
Status: NEW → ASSIGNED
Attachment #258627 - Flags: review?(LpSolit)
$dbh->bz_unlock_tables(); + $dbh->bz_commit_transaction(); shouldn't bz_unlock_tables be nuked?
Attached patch v2Splinter Review
Okay, I thought about this some more, and I think what's most important right now is to avoid the "orphan comment" if something causes us to rollback. So I'm not using transactions in post_bug.cgi, and we'll just have to work on Bug::create supporting attachments and so on.
Attachment #258627 - Attachment is obsolete: true
Attachment #258628 - Flags: review?(LpSolit)
Attachment #258627 - Flags: review?(LpSolit)
(In reply to comment #2) > $dbh->bz_unlock_tables(); > + $dbh->bz_commit_transaction(); > > shouldn't bz_unlock_tables be nuked? In that version of the patch I was still locking longdescs, and committing may implicitly unlock tables in MySQL, but it doesn't unlock them as far as Bugzilla knows.
Comment on attachment 258628 [details] [diff] [review] v2 Works fine on both MySQL 5.0.24 and Pg 8.1.8. r=LpSolit
Attachment #258628 - Flags: review?(LpSolit) → review+
Flags: approval+
Checking in Bugzilla/Bug.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v <-- Bug.pm new revision: 1.176; previous revision: 1.175 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: