aboutsummaryrefslogtreecommitdiffstats
path: root/editproducts.cgi
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 /editproducts.cgi
parenta81a0804496d263f9de71b03e2ebf612e3c534cc (diff)
downloadbugs-24a90239690d3c59538cb4044bc31411efd83464.tar
bugs-24a90239690d3c59538cb4044bc31411efd83464.tar.gz
bugs-24a90239690d3c59538cb4044bc31411efd83464.tar.bz2
bugs-24a90239690d3c59538cb4044bc31411efd83464.tar.xz
bugs-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 'editproducts.cgi')
-rwxr-xr-xeditproducts.cgi20
1 files changed, 6 insertions, 14 deletions
diff --git a/editproducts.cgi b/editproducts.cgi
index c3b29747c..5a937db9d 100755
--- a/editproducts.cgi
+++ b/editproducts.cgi
@@ -407,10 +407,7 @@ if ($action eq 'delete') {
}
}
- $dbh->bz_lock_tables('products WRITE', 'components WRITE',
- 'versions WRITE', 'milestones WRITE',
- 'group_control_map WRITE', 'component_cc WRITE',
- 'flaginclusions WRITE', 'flagexclusions WRITE');
+ $dbh->bz_start_transaction();
my $comp_ids = $dbh->selectcol_arrayref('SELECT id FROM components
WHERE product_id = ?',
@@ -440,7 +437,7 @@ if ($action eq 'delete') {
$dbh->do("DELETE FROM products WHERE id = ?",
undef, $product->id);
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
delete_token($token);
@@ -587,12 +584,7 @@ if ($action eq 'updategroupcontrols') {
{groupname => $groupname});
}
}
- $dbh->bz_lock_tables('groups READ',
- 'group_control_map WRITE',
- 'bugs WRITE',
- 'bugs_activity WRITE',
- 'bug_group_map WRITE',
- 'fielddefs READ');
+ $dbh->bz_start_transaction();
my $sth_Insert = $dbh->prepare('INSERT INTO group_control_map
(group_id, product_id, entry, membercontrol,
@@ -771,7 +763,7 @@ if ($action eq 'updategroupcontrols') {
push(@added_mandatory, \%group);
}
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
delete_token($token);
@@ -847,7 +839,7 @@ if ($action eq 'update') {
{votestoconfirm => $stored_votestoconfirm});
}
- $dbh->bz_lock_tables('products WRITE', 'milestones READ');
+ $dbh->bz_start_transaction();
my $testproduct =
new Bugzilla::Product({name => $product_name});
@@ -917,7 +909,7 @@ if ($action eq 'update') {
undef, ($product_name, $product_old->id));
}
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
my $product = new Bugzilla::Product({name => $product_name});