);
}
+ public function preCommitCallbacksPending() {
+ return $this->trxLevel && $this->trxPreCommitCallbacks;
+ }
+
/**
* @return string|null
*/
}
/**
- * Get the list of method names that have pending write queries or that
- * have transaction callbacks that have yet to run
+ * List the methods that have write queries or callbacks for the current transaction
*
- * @return array
+ * This method should not be used outside of Database/LoadBalancer
+ *
+ * @return string[]
+ * @since 1.32
*/
- protected function pendingWriteAndCallbackCallers() {
+ public function pendingWriteAndCallbackCallers() {
$fnames = $this->pendingWriteCallers();
foreach ( [
$this->trxIdleCallbacks,
$this->trxEndCallbacks[] = [ $callback, $fname, $this->currentAtomicSectionId() ];
}
- final public function onTransactionIdle( callable $callback, $fname = __METHOD__ ) {
+ final public function onTransactionCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
if ( !$this->trxLevel && $this->getTransactionRoundId() ) {
// Start an implicit transaction similar to how query() does
$this->begin( __METHOD__, self::TRANSACTION_INTERNAL );
}
}
+ final public function onTransactionIdle( callable $callback, $fname = __METHOD__ ) {
+ $this->onTransactionCommitOrIdle( $callback, $fname );
+ }
+
final public function onTransactionPreCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
if ( !$this->trxLevel && $this->getTransactionRoundId() ) {
// Start an implicit transaction similar to how query() does
}
}
-class_alias( Database::class, 'DatabaseBase' ); // b/c for old name
-class_alias( Database::class, 'Database' ); // b/c global alias
+/**
+ * @deprecated since 1.28
+ */
+class_alias( Database::class, 'DatabaseBase' );
+
+/**
+ * @deprecated since 1.29
+ */
+class_alias( Database::class, 'Database' );