File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
lib/internal/Magento/Framework Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,8 @@ public function commit()
314
314
*/
315
315
public function rollBack ()
316
316
{
317
+ /** This is done for S2 build in order to see where transaction is rolled back */
318
+ var_dump (debug_backtrace (10 ));
317
319
if ($ this ->_transactionLevel === 1 ) {
318
320
$ this ->logger ->startTimer ();
319
321
parent ::rollBack ();
Original file line number Diff line number Diff line change @@ -169,8 +169,10 @@ public function applyDataPatch($moduleName = null)
169
169
$ this ->patchHistory ->fixPatch (get_class ($ dataPatch ));
170
170
} else {
171
171
try {
172
+ $ this ->moduleDataSetup ->getConnection ()->beginTransaction ();
172
173
$ dataPatch ->apply ();
173
174
$ this ->patchHistory ->fixPatch (get_class ($ dataPatch ));
175
+ $ this ->moduleDataSetup ->getConnection ()->commit ();
174
176
} catch (\Exception $ e ) {
175
177
$ this ->moduleDataSetup ->getConnection ()->rollBack ();
176
178
throw new Exception (new Phrase ($ e ->getMessage ()));
@@ -261,9 +263,11 @@ public function revertDataPatches($moduleName = null)
261
263
);
262
264
if ($ dataPatch instanceof PatchRevertableInterface) {
263
265
try {
266
+ $ adapter ->beginTransaction ();
264
267
/** @var PatchRevertableInterface|DataPatchInterface $dataPatch */
265
268
$ dataPatch ->revert ();
266
269
$ this ->patchHistory ->revertPatchFromHistory (get_class ($ dataPatch ));
270
+ $ adapter ->commit ();
267
271
} catch (\Exception $ e ) {
268
272
$ adapter ->rollBack ();
269
273
throw new Exception (new Phrase ($ e ->getMessage ()));
You can’t perform that action at this time.
0 commit comments