create( 'Magento\Sales\Model\ResourceModel\Report\Bestsellers' ); $reportResource->beginTransaction(); // prevent table truncation by incrementing the transaction nesting level counter try { $reportResource->aggregate(); $reportResource->commit(); } catch (\Exception $e) { $reportResource->rollBack(); throw $e; }