$this->trxAtomicCounter = 0;
$this->trxIdleCallbacks = []; // T67263; transaction already lost
$this->trxPreCommitCallbacks = []; // T67263; transaction already lost
+ // Clear additional subclass fields
+ $this->doHandleSessionLossPreconnect();
// @note: leave trxRecurringCallbacks in place
if ( $this->trxDoneWrites ) {
$this->trxProfiler->transactionWritingOut(
}
}
+ /**
+ * Reset any additional subclass trx* and session* fields
+ */
+ protected function doHandleSessionLossPreconnect() {
+ // no-op
+ }
+
/**
* Clean things up after session (and thus transaction) loss after reconnect
*/
if ( in_array( $entry[2], $sectionIds, true ) ) {
$callback = $entry[0];
$this->trxEndCallbacks[$key][0] = function () use ( $callback ) {
- // @phan-suppress-next-line PhanInfiniteRecursion No recursion at all here, phan is confused
+ // @phan-suppress-next-line PhanInfiniteRecursion, PhanUndeclaredInvokeInCallable
return $callback( self::TRIGGER_ROLLBACK, $this );
};
// This "on resolution" callback no longer belongs to a section.
try {
++$count;
list( $phpCallback ) = $callback;
+ // @phan-suppress-next-line PhanUndeclaredInvokeInCallable
$phpCallback( $this );
} catch ( Exception $ex ) {
( $this->errorLogger )( $ex );
foreach ( $callbacks as $entry ) {
if ( $sectionIds === null || in_array( $entry[2], $sectionIds, true ) ) {
try {
+ // @phan-suppress-next-line PhanUndeclaredInvokeInCallable
$entry[0]( $trigger, $this );
} catch ( Exception $ex ) {
( $this->errorLogger )( $ex );