$type = isset( $info['type'] ) ? $info['type'] : 'mysql';
$host = isset( $info['host'] ) ? $info['host'] : '[unknown]';
$this->logger->debug( __CLASS__ . ": connecting to $host" );
+ // Use a blank trx profiler to ignore expections as this is a cache
+ $info['trxProfiler'] = new TransactionProfiler();
$db = DatabaseBase::factory( $type, $info );
$db->clearFlag( DBO_TRX );
} else {
return $newValue;
}
+ public function merge( $key, $callback, $exptime = 0, $attempts = 10 ) {
+ if ( !is_callable( $callback ) ) {
+ throw new Exception( "Got invalid callback." );
+ }
+
+ return $this->mergeViaCas( $key, $callback, $exptime, $attempts );
+ }
+
/**
* @param DatabaseBase $db
* @param string $exptime
$this->markServerDown( $exception, $serverIndex );
}
if ( $exception->db && $exception->db->wasReadOnlyError() ) {
- try {
- $exception->db->rollback( __METHOD__ );
- } catch ( DBError $e ) {
+ if ( $exception->db->trxLevel() ) {
+ try {
+ $exception->db->rollback( __METHOD__ );
+ } catch ( DBError $e ) {
+ }
}
}