View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006102||OXID eShop (all versions)||1.03. Basket, checkout process||public||2015-03-25 18:18||2017-08-03 11:15|
|Product Version||4.9.3 / 5.2.3|
|Target Version||Fixed in Version||4.10.6 / 5.3.6|
|Summary||0006102: Article Stock Function causes wrong stock levels in high load scenarios / Use transactions|
|Description||The 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 Reproduce||0. 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 Information||This issue occurs on webservers with many concurrent users. Please implement transactions at this point!|
|PHP Version||Not defined|
|Database Version||Not defined|
||This issue most likely also can occur when basket reservations are turned off when orders are committed into the database.|
||Updated the title so I could better remember the issue|
||Location in source code: https://github.com/OXID-eSales/oxideshop_ce/blob/b-dev-ce/source/application/models/oxarticle.php#L2098|
Location in actual oxid 6.0 repository (2017-01-13)
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.
||Any update on this?|
The bug is fixed in the development version 6.0. A backport for Version 4.10.x should follow soon ...