View Issue Details

IDProjectCategoryView StatusLast Update
0007192OXID eShop (all versions)4.01. Database handlingpublic2020-11-17 12:55
ReporterQA Assigned To 
Status acknowledgedResolutionopen 
Product Version6.2.3 
Summary0007192: Master Slave Database balancing - category listing (alist) - using the Master DB in model classes
DescriptionWe have tested our test system Balancing with and without contentcache according to
The category list (alist) is considered

1. without content cache: select queries on master 6130, queries on slave 74
2. with content cache: 38/32 select queries

The ratio without content cache was 85:1 on Master DB.
Conspicuous are explicit usage of the master DB in model classes.
The use of master DB in this call is not exactly explained or not really thought through:

oxideshop-ee/Application/Model/Fields2Shop.php (106)

public function setProductData($oProduct)
    // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
    $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
    $sQ = "select oxid from oxfield2shop where oxartid=" . $masterDb->quote($oProduct->getId()) . " and oxshopid= " . $masterDb->quote($this->getConfig()->getShopId());

This function is called when loading from any article list (in frontend), if prices should be loaded and the clients have different prices, which is the strength of the EE version. But the call leaves the database on the master and thus practically switches off the balancing, which explains the bad distribution.
Steps To Reproduce1. Install master slave DB and set aSlaveHost Array in
2. Activate and deactivate dynamic content caching
2. Category listing (alist) in frontend
3. Look at the query log on master and slave host
Additional Information- es -
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined


There are no notes attached to this issue.