summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-10-10 04:21:48 +0000
committerlpsolit%gmail.com <>2007-10-10 04:21:48 +0000
commit24a90239690d3c59538cb4044bc31411efd83464 (patch)
tree09242819613a0cd56319b09bf258077dce147d70 /editclassifications.cgi
parentMidair with product change while adding an attachment silently clears flags -... (diff)
downloadbugzilla-24a90239690d3c59538cb4044bc31411efd83464.tar.gz
bugzilla-24a90239690d3c59538cb4044bc31411efd83464.tar.bz2
bugzilla-24a90239690d3c59538cb4044bc31411efd83464.zip
Bug 398976: edit*.cgi scripts should use transactions for database interaction - Patch by Emmanuel Seyman <eseyman@linagora.com> r/a=mkanat
Diffstat (limited to 'editclassifications.cgi')
-rwxr-xr-xeditclassifications.cgi8
1 files changed, 4 insertions, 4 deletions
diff --git a/editclassifications.cgi b/editclassifications.cgi
index 0ebfb97fa..cacc47fb6 100755
--- a/editclassifications.cgi
+++ b/editclassifications.cgi
@@ -172,7 +172,7 @@ if ($action eq 'delete') {
}
# lock the tables before we start to change everything:
- $dbh->bz_lock_tables('classifications WRITE', 'products WRITE');
+ $dbh->bz_start_transaction();
# delete
$dbh->do("DELETE FROM classifications WHERE id = ?", undef,
@@ -182,7 +182,7 @@ if ($action eq 'delete') {
$dbh->do("UPDATE products SET classification_id = 1
WHERE classification_id = ?", undef, $classification->id);
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
$vars->{'classification'} = $classification;
@@ -229,7 +229,7 @@ if ($action eq 'update') {
|| ThrowUserError('classification_invalid_sortkey', {'name' => $class_old->name,
'sortkey' => $stored_sortkey});
- $dbh->bz_lock_tables('classifications WRITE');
+ $dbh->bz_start_transaction();
if ($class_name ne $class_old->name) {
@@ -262,7 +262,7 @@ if ($action eq 'update') {
$vars->{'updated_sortkey'} = 1;
}
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
delete_token($token);
LoadTemplate($action);