Merge "rdbms: merge isClean() into popAtomicLevels() in TransactionManager"
This commit is contained in:
commit
64475f3edf
2 changed files with 5 additions and 4 deletions
|
|
@ -2164,10 +2164,10 @@ abstract class Database implements Stringable, IDatabaseForOwner, IMaintainableD
|
|||
$cs = $this->commenceCriticalSection( __METHOD__ );
|
||||
|
||||
// Remove the last section (no need to re-index the array)
|
||||
$this->transactionManager->popAtomicLevel();
|
||||
$finalLevelOfImplicitTrxPopped = $this->transactionManager->popAtomicLevel();
|
||||
|
||||
try {
|
||||
if ( $this->transactionManager->isClean() ) {
|
||||
if ( $finalLevelOfImplicitTrxPopped ) {
|
||||
$this->commit( $fname, self::FLUSHING_INTERNAL );
|
||||
$runPostCommitCallbacks = true;
|
||||
} elseif ( $savepointId !== null && $savepointId !== self::NOT_APPLICABLE ) {
|
||||
|
|
|
|||
|
|
@ -523,11 +523,12 @@ class TransactionManager {
|
|||
return [ $savedFname, $excisedIds, $newTopSection, $savedSectionId, $savepointId ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool Whether no levels remain and transaction was started by a popped level
|
||||
*/
|
||||
public function popAtomicLevel() {
|
||||
array_pop( $this->trxAtomicLevels );
|
||||
}
|
||||
|
||||
public function isClean() {
|
||||
return !$this->trxAtomicLevels && $this->trxAutomaticAtomic;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue