Skip to content

Commit

Permalink
MAGETWO-67447: Change commit to rollBack on fail #6266
Browse files Browse the repository at this point in the history
  • Loading branch information
vrann authored Apr 19, 2017
2 parents cac21cb + ebf256e commit 273b8f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/code/Magento/CatalogInventory/Model/StockManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function registerProductsSale($items, $websiteId = null)
if (!$stockItem->hasAdminArea()
&& !$this->stockState->checkQty($productId, $orderedQty, $stockItem->getWebsiteId())
) {
$this->getResource()->commit();
$this->getResource()->rollBack();
throw new \Magento\Framework\Exception\LocalizedException(
__('Not all of your products are available in the requested quantity.')
);
Expand Down Expand Up @@ -180,7 +180,7 @@ protected function getProductType($productId)
}

/**
* @return Stock
* @return ResourceStock
*/
protected function getResource()
{
Expand Down

0 comments on commit 273b8f9

Please sign in to comment.