Refresh not working: Issue after resetting Doctrine Manager
<p>There is something wrong with my data, I get the error <code>out of range on a integer column</code> and I try to prevent <code>Close Entity Manager</code> from continuing to work, as I<code>reset manager</code> in exception</p >
<pre class="brush:php;toolbar:false;">public function renewDeliveryTime($delayReport) : void
{
try {
$this->delayReportRepository->updateRenewedDeliveryTimeAt($delayReport, 50000000);
}catch (\Exception $exception){
// out of range error
$this->managerRegistry->resetManager();
}
}
public function updateRenewedDeliveryTimeAt($delayReport,$delayDuration)
{
/*** @var DelayReport $delayReport*/
$delayReport->setDelayDuration($delayDuration);
$delayReport->setStatus(DelayReport::STATUS['DONE']);
$this->getEntityManager()->flush();
}</pre>
<p>The problem is, I'm running into an error in my data, I'm getting the error message <code>out of range on a integer column</code>, and I'm trying to prevent <code>closed entity manager< /code>Continue working and for this purpose in the exception <code>reset manager</code></p>
<pre class="brush:php;toolbar:false;">public function enqueue($delayReport) : void
{
$this->pushInQueueReport($delayReport);
$this->delayReportRepository->updateStatus($delayReport, DelayReport::STATUS['IN_QUEUE']);
}
public function updateStatus($delayReport, $status)
{
/*** @var DelayReport $delayReport*/
$delayReport->setStatus($status);
$this->getEntityManager()->flush();
}</pre>
<p>The problem is that after I have another object and almost the same database operation, it seems that <code>$this->getEntityManager()->flush()</code> no longer works, database Nothing happens. This has to do with <code>$this->managerRegistry->resetManager()</code></p>
<p>What is the solution to this problem? </p>