Skip to content

Commit

Permalink
chore: add temporary workaround to expose PDO exceptions from commits
Browse files Browse the repository at this point in the history
these are caused by postgres constraint issues, and are not currently
handled well by doctrine:

doctrine#7545
  • Loading branch information
rodnaph committed Jun 1, 2024
1 parent 94986af commit ef0b254
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,11 @@ public function commit($entity = null)
$this->em->close();

if ($conn->isTransactionActive()) {
$conn->rollBack();
try {
$conn->rollBack();
} catch (Exception) {
// Swallow to preserve commit exception.
}
}

$this->afterTransactionRolledBack();
Expand Down

3 comments on commit ef0b254

@adlpz
Copy link

@adlpz adlpz commented on ef0b254 Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rodnaph! Just saw this commit linked in doctrine#7545 while investigating the same issue. Small world!

Just wanted to say hi, hope things are going well over at owsy/bindhq 😃.

@rodnaph
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Adria - good to hear from you! Yes, all going fine at bindhq thanks, bit less clojure these days though 😢

Similar issue in Messenger incase this one bites you too - symfony/symfony#54355

Hope you're well.

@adlpz
Copy link

@adlpz adlpz commented on ef0b254 Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bit less clojure these days though 😢

Yeah, a shame it didn't really get much more traction in the industry 😭. It's all about tons of JS and good old symfony for me these days too.

Thanks for the tip about Messenger!

Please sign in to comment.