Jira issue originally created by user cloun:
Recently I have faced with strange behavior: I was adding records to a table, but some was not added. While these were adding, nothing happend. I have find out the source of the problem - I have unique constrain in my table (I forgot about it), and some records are duplicates.
But in order to find out that what was happening, I had to rummage in the bowels of the Doctrine. And I have found out why it happend: in the class Doctrine/ORM/Persisters/StandardEntityPersister, method public function executeInserts() execute $stmt->execute() and doesn't handle return value, and erorr info.
I suggest something like that:\
if (!$stmt->execute() && $catchDriverErrors)\
list($sqlState, $errorCode, $erroMsg) = $stmt->errorInfo();\
throw new \Exception(sprintf("Something bad was happend in Database Layer: %s (%s) '%s'", $sqlState, $errorCode, $erroMsg));\
Comment created by cloun:
added line break
Comment created by @beberlei:
Do you use your own PDO connection? If yes, you should call:
before passing it to Doctrine.
Oh, it's very simple.. Thanks for suggestion!
Issue was closed with resolution "Won't Fix"