# Keep track of whether the transaction has write queries pending
if ( $this->mTrxLevel && !$this->mTrxDoneWrites && $this->isWriteQuery( $sql ) ) {
$this->mTrxDoneWrites = true;
- Profiler::instance()->transactionWritingIn( $this->mServer, $this->mDBname );
+ $id = spl_object_hash( $this );
+ Profiler::instance()->transactionWritingIn( $this->mServer, $this->mDBname, $id );
}
$queryProf = '';
$this->runOnTransactionPreCommitCallbacks();
$this->doCommit( $fname );
if ( $this->mTrxDoneWrites ) {
- Profiler::instance()->transactionWritingOut( $this->mServer, $this->mDBname );
+ $id = spl_object_hash( $this );
+ Profiler::instance()->transactionWritingOut( $this->mServer, $this->mDBname, $id );
}
$this->runOnTransactionIdleCallbacks();
}
$this->runOnTransactionPreCommitCallbacks();
$this->doCommit( $fname );
if ( $this->mTrxDoneWrites ) {
- Profiler::instance()->transactionWritingOut( $this->mServer, $this->mDBname );
+ $id = spl_object_hash( $this );
+ Profiler::instance()->transactionWritingOut( $this->mServer, $this->mDBname, $id );
}
$this->runOnTransactionIdleCallbacks();
}
$this->mTrxPreCommitCallbacks = array(); // cancel
$this->mTrxAtomicLevels = new SplStack;
if ( $this->mTrxDoneWrites ) {
- Profiler::instance()->transactionWritingOut( $this->mServer, $this->mDBname );
+ $id = spl_object_hash( $this );
+ Profiler::instance()->transactionWritingOut( $this->mServer, $this->mDBname, $id );
}
}
*
* @param string $server DB server
* @param string $db DB name
+ * @param string $id Resource ID string of connection
*/
- public function transactionWritingIn( $server, $db ) {
- $this->trxProfiler->transactionWritingIn( $server, $db );
+ public function transactionWritingIn( $server, $db, $id = '' ) {
+ $this->trxProfiler->transactionWritingIn( $server, $db, $id );
}
/**
*
* @param string $server DB server
* @param string $db DB name
+ * @param string $id Resource ID string of connection
*/
- public function transactionWritingOut( $server, $db ) {
- $this->trxProfiler->transactionWritingOut( $server, $db );
+ public function transactionWritingOut( $server, $db, $id = '' ) {
+ $this->trxProfiler->transactionWritingOut( $server, $db, $id );
}
/**
*
* @param string $server DB server
* @param string $db DB name
+ * @param string $id Resource ID string of connection
*/
- public function transactionWritingIn( $server, $db ) {
- $name = "{$server} ({$db})";
+ public function transactionWritingIn( $server, $db, $id ) {
+ $name = "{$server} ({$db}) ($id)";
if ( isset( $this->mDBTrxHoldingLocks[$name] ) ) {
++$this->mDBTrxHoldingLocks[$name]['refs'];
} else {
*
* @param string $server DB server
* @param string $db DB name
+ * @param string $id Resource ID string of connection
*/
- public function transactionWritingOut( $server, $db ) {
- $name = "{$server} ({$db})";
+ public function transactionWritingOut( $server, $db, $id ) {
+ $name = "{$server} ({$db}) ($id)";
if ( --$this->mDBTrxHoldingLocks[$name]['refs'] <= 0 ) {
$slow = false;
foreach ( $this->mDBTrxMethodTimes[$name] as $info ) {
public function close() {}
public function logData() {}
public function getCurrentSection() { return ''; }
- public function transactionWritingIn( $server, $db ) {}
- public function transactionWritingOut( $server, $db ) {}
+ public function transactionWritingIn( $server, $db, $id = '' ) {}
+ public function transactionWritingOut( $server, $db, $id = '' ) {}
public function getRawData() { return array(); }
}