Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/265625
Change subject: Remove begin()/commit() calls that can break outer transactions
......................................................................
Remove begin()/commit() calls that can break outer transactions
The single statements are already atomic and will commit at
the end of the request in commitMasterChanges().
Bug: T120791
Change-Id: I03ec06776d9dc3cfac2ef4a19f550d5db88bdfc7
---
M server/api/ApiReflectAction.php
1 file changed, 0 insertions(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Reflect
refs/changes/25/265625/1
diff --git a/server/api/ApiReflectAction.php b/server/api/ApiReflectAction.php
index c52c2df..5a53934 100644
--- a/server/api/ApiReflectAction.php
+++ b/server/api/ApiReflectAction.php
@@ -165,9 +165,7 @@
} else {
/*
* w/o lock, the following could lead to a race condition
- * TODO: should $wgAntiLockFlags be used here?
*/
- $dbw->begin( __METHOD__ ); // start
transaction
$res = $dbr->query(
'SELECT MAX(bl_id)+1 AS next_bullet_id FROM ' .
$dbr->tableName(
'reflect_bullet_revision' )
@@ -187,10 +185,6 @@
) );
$bulletRev = $dbw->insertId();
-
- if ( !$modify ) {
- $dbw->commit( __METHOD__ ); // end transaction
- }
if ( isset( $params['highlights'] ) ) {
$highlights = json_decode( str_replace( '\\', '',
@@ -276,10 +270,7 @@
} else {
/*
* w/o lock, the following could lead to a race condition
- * TODO: should $wgAntiLockFlags be used here?
*/
- $dbw->begin( __METHOD__ ); // start
transaction
-
$res = $dbr->query(
'select MAX(rsp_id)+1 as next_rsp_id from ' .
$dbr->tableName(
'reflect_response_revision' )
@@ -299,10 +290,6 @@
'rsp_signal' => $signal
));
$responseRev = $dbw->insertId();
-
- if ( !$modify ) {
- $dbw->commit( __METHOD__ ); // end transaction
- }
if ( $modify ) {
/* shouldn't lead to race condition as long as
--
To view, visit https://gerrit.wikimedia.org/r/265625
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I03ec06776d9dc3cfac2ef4a19f550d5db88bdfc7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Reflect
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits