Skip to content

Commit ecbc5d0

Browse files
author
Sergii Kovalenko
committed
MAGETWO-88054: Stabilize S1 build
--move migration to Staging module
1 parent 57fadcb commit ecbc5d0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ public function commit()
314314
*/
315315
public function rollBack()
316316
{
317+
/** This is done for S2 build in order to see where transaction is rolled back */
318+
var_dump(debug_backtrace(10));
317319
if ($this->_transactionLevel === 1) {
318320
$this->logger->startTimer();
319321
parent::rollBack();

lib/internal/Magento/Framework/Setup/Patch/PatchApplier.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,10 @@ public function applyDataPatch($moduleName = null)
169169
$this->patchHistory->fixPatch(get_class($dataPatch));
170170
} else {
171171
try {
172+
$this->moduleDataSetup->getConnection()->beginTransaction();
172173
$dataPatch->apply();
173174
$this->patchHistory->fixPatch(get_class($dataPatch));
175+
$this->moduleDataSetup->getConnection()->commit();
174176
} catch (\Exception $e) {
175177
$this->moduleDataSetup->getConnection()->rollBack();
176178
throw new Exception(new Phrase($e->getMessage()));
@@ -261,9 +263,11 @@ public function revertDataPatches($moduleName = null)
261263
);
262264
if ($dataPatch instanceof PatchRevertableInterface) {
263265
try {
266+
$adapter->beginTransaction();
264267
/** @var PatchRevertableInterface|DataPatchInterface $dataPatch */
265268
$dataPatch->revert();
266269
$this->patchHistory->revertPatchFromHistory(get_class($dataPatch));
270+
$adapter->commit();
267271
} catch (\Exception $e) {
268272
$adapter->rollBack();
269273
throw new Exception(new Phrase($e->getMessage()));

0 commit comments

Comments
 (0)