View Issue Details

IDProjectCategoryView StatusLast Update
0006102OXID eShop (all versions)1.03. Basket, checkout processpublic2017-08-03 11:15
Reportervschmi 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.9.3 / 5.2.3 
Target VersionFixed in Version4.10.6 / 5.3.6 
Summary0006102: Article Stock Function causes wrong stock levels in high load scenarios / Use transactions
DescriptionThe article stock function in combination with basket reservation causes wrong stock levels. This occurs when much traffic is on the website, because OXID does not use transactions at this point.
Steps To Reproduce0. Open the file oxarticle.php, locate the method reduceStock and add a sleep(10) prior $oDB->execute('update ...') so that it's easier to reproduce
1. Activate Basket Reservations
2. Create a new article with stock level 1
3. Open up 2 different browsers so you get 2 different sessions for the frontend
4. Add the newly created article in the first window, then in the second window
5. You should now have one article reserved in both baskets. If you check the stock level, it displays 0. If you check the table oxbasketitems, you'll find that the item is really added to both baskets.
6. The users could now order the articles
7. If you remove the item from both baskets, the stock level will then be 2.
Additional InformationThis issue occurs on webservers with many concurrent users. Please implement transactions at this point!
TagsHigh_Load, Stock
ThemeAll
BrowserAll
PHP VersionNot defined
MySQL VersionNot defined

Relationships

has duplicate 0004317 closedQA OXID private sales is not compatable with the high attendance shops 

Activities

vschmi

2015-03-27 12:29

reporter   ~0010841

This issue most likely also can occur when basket reservations are turned off when orders are committed into the database.

florian.auer

2015-06-29 10:21

developer   ~0011064

Updated the title so I could better remember the issue

florian.auer

2016-01-20 11:39

developer   ~0011442

Location in source code: https://github.com/OXID-eSales/oxideshop_ce/blob/b-dev-ce/source/application/models/oxarticle.php#L2098

mario_lorenz

2017-01-13 10:51

reporter   ~0011917

Location in actual oxid 6.0 repository (2017-01-13)
https://github.com/OXID-eSales/oxideshop_ce/blob/master/source/Application/Model/Article.php#L2193

Please fix this high priority Bug. We have many troubles with correct stocks in a ticketshop where stocks can be sold, reserved, reduced etc. in seconds.

vschmi

2017-05-17 16:50

reporter   ~0012093

Any update on this?

mario_lorenz

2017-07-28 13:40

reporter   ~0012193

Breaking News:

The bug is fixed in the development version 6.0. A backport for Version 4.10.x should follow soon ...

https://github.com/OXID-eSales/oxideshop_ce/blob/7bf2a15ce5e5a2814de2d4be476f0d663dbc063d/CHANGELOG.md
https://github.com/OXID-eSales/oxideshop_ce/commit/e880d6c7e2404bec03653c86c80886e97cfb959b
https://github.com/OXID-eSales/oxideshop_ce/commit/327a2bb7f7c50670c1b8fa6d771bacfef4eb1c93