Skip to content

Allow JobStorage to reset the EntityManager #586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow JobStorage to reset the EntityManager
After a Job triggers a Doctrine exception, and handles it, the EntityManager still remains closed and JobStorage can't persist changes. This fix resets the Manager after such an occurrence.
  • Loading branch information
damijank authored Oct 26, 2018
commit c13f35cbb001b5baacabb485bf0dffbbcea90604
3 changes: 3 additions & 0 deletions pkg/job-queue/Doctrine/JobStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ private function getEntityManager()
if (!$this->em) {
$this->em = $this->doctrine->getManagerForClass($this->entityClass);
}
if (!$this->em->isOpen()) {
$this->em = $this->doctrine->resetManager();
}

return $this->em;
}
Expand Down