+ /**
+ * Call runOnTransactionPreCommitCallbacks() on all DB handles
+ *
+ * This method should not be used outside of LBFactory/LoadBalancer
+ *
+ * @since 1.28
+ */
+ public function runPreCommitCallbacks() {
+ $masterIndex = $this->getWriterIndex();
+ foreach ( $this->mConns as $conns2 ) {
+ if ( empty( $conns2[$masterIndex] ) ) {
+ continue;
+ }
+ /** @var DatabaseBase $conn */
+ foreach ( $conns2[$masterIndex] as $conn ) {
+ if ( $conn->trxLevel() && $conn->writesOrCallbacksPending() ) {
+ $conn->runOnTransactionPreCommitCallbacks();
+ }
+ }
+ }
+ }
+