Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
fce3b962
Commit
fce3b962
authored
Mar 24, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 374012: Use transactions inside of Bugzilla::Object
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
parent
0eb69c79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
Object.pm
Bugzilla/Object.pm
+9
-1
No files found.
Bugzilla/Object.pm
View file @
fce3b962
...
...
@@ -171,6 +171,8 @@ sub update {
my
$table
=
$self
->
DB_TABLE
;
my
$id_field
=
$self
->
ID_FIELD
;
$dbh
->
bz_start_transaction
();
my
$old_self
=
$self
->
new
(
$self
->
id
);
my
(
@update_columns
,
@values
,
%
changes
);
...
...
@@ -199,6 +201,8 @@ sub update {
$dbh
->
do
(
"UPDATE $table SET $columns WHERE $id_field = ?"
,
undef
,
@values
,
$self
->
id
)
if
@values
;
$dbh
->
bz_commit_transaction
();
return
\%
changes
;
}
...
...
@@ -210,9 +214,13 @@ sub create {
my
(
$class
,
$params
)
=
@_
;
my
$dbh
=
Bugzilla
->
dbh
;
$dbh
->
bz_start_transaction
();
$class
->
check_required_create_fields
(
$params
);
my
$field_values
=
$class
->
run_create_validators
(
$params
);
return
$class
->
insert_create_data
(
$field_values
);
my
$object
=
$class
->
insert_create_data
(
$field_values
);
$dbh
->
bz_commit_transaction
();
return
$object
;
}
sub
check_required_create_fields
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment