$beforeWriteEvent = EntityWriteEvent::
create($context,
$commands);
$this->eventDispatcher->
dispatch($beforeWriteEvent);
try { RetryableTransaction::
retryable($this->connection,
function D
) use ($commands,
$context): void
{ $this->
executeCommands($commands,
$context);
});
$beforeWriteEvent->
success();
} catch (\Throwable
$e) { $event =
new WriteCommandExceptionEvent($e,
$commands,
$context->
getContext());
$this->eventDispatcher->
dispatch($event);
$beforeWriteEvent->
error();
throw $e;
} } /**
* @param list<WriteCommand> $commands
*/