protected $delimiter = ';';
+ /**
+ * Remembers the function name given for starting the most recent transaction via the begin() method.
+ * Used to provide additional context for error reporting.
+ *
+ * @var String
+ * @see DatabaseBase::mTrxLevel
+ */
+ private $mTrxFname = null;
+
# ------------------------------------------------------------------------------
# Accessors
# ------------------------------------------------------------------------------
*/
final public function begin( $fname = 'DatabaseBase::begin' ) {
if ( $this->mTrxLevel ) { // implicit commit
+ wfWarn( "$fname: Transaction already in progress (from {$this->mTrxFname}), " .
+ " performing implicit commit!" );
$this->doCommit( $fname );
$this->runOnTransactionIdleCallbacks();
}
$this->doBegin( $fname );
+ $this->mTrxFname = $fname;
}
/**
* @param $fname string
*/
final public function commit( $fname = 'DatabaseBase::commit' ) {
+ if ( !$this->mTrxLevel ) {
+ wfWarn( "$fname: No transaction to commit, something got out of sync!" );
+ }
$this->doCommit( $fname );
$this->runOnTransactionIdleCallbacks();
}
* @param $fname string
*/
final public function rollback( $fname = 'DatabaseBase::rollback' ) {
+ if ( !$this->mTrxLevel ) {
+ wfWarn( "$fname: No transaction to rollback, something got out of sync!" );
+ }
$this->doRollback( $fname );
$this->trxIdleCallbacks = array(); // cancel
}