Problem "The EntityManager is closed."

toto -  
 toto -
Hello,

I have an error that occurred after declaring a service.

"The EntityManager is closed."

So I did a
echo 'Exception received: ', $e->getMessage(), "\n";
to display the exact error, and it comes from the fact that I want to enter a null value for my created_at field. However, I proceeded in the same way for the same service in another app and I never had this error..

Any ideas?

Thanks in advance.

Configuration: Windows / Chrome 53.0.2785.116

2 answers

  1. jordane45 Posted messages 30426 Registration date   Status Moderator Last intervention   4 830
     
    Hello,

    It's probably because you're trying to insert a NULL value into a field where "NULL" is not allowed in your database...
    Start by checking the relevant table.

    --
    Best regards,
    Jordane
    0
    1. toto
       
      Yes, I know, I checked and indeed the NULL field is set to "NO", but in my other app, this same field was declared like this and it worked perfectly well :/
      0
      1. jordane45 Posted messages 30426 Registration date   Status Moderator Last intervention   4 830 > toto
         
        I can't tell you why it was bugged before and now it's not...
        because that's exactly how it should be viewed...
        0
    2. toto
       
      Okay :/ I'll keep looking then .. Thanks anyway
      0
  2. ThEBiShOp Posted messages 9307 Registration date   Status Contributor Last intervention   1 605
     
    How is your created_at field managed?
    If it's automatic, make sure that its value is filled correctly (obviously, that's not the case since you have null)
    If it's manual, well, the same goes, enter your value manually.
    0
    1. toto
       
      My created_at field is managed automatically because in my old app I didn't have to manage it.
      0
    2. ThEBiShOp Posted messages 9307 Registration date   Status Contributor Last intervention   1 605
       
      And what is responsible for that?

      You might have a service or something else that should take care of it but isn't working anymore.
      0
    3. toto
       
      Indeed, in my services I manage all my logs and I know that it's a typical error of a problem at the service level, but I really don't see the issue because my error is simply "The EntityManager is closed."
      0