-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added a note concerning the tearDown method #4953
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
Conversation
Added a hint to properly close the connection depending on the PHP version.
this is not clear enough to me, we should provide a like to some kind of issue related to this. |
I agree with @timglabisch. @Meyfarth What are the conditions under which you to call the function and when do you have to do it? We should clarify them. |
I had the problem on my server : when testing with phpunit, I ended up with a "Too many connections" error. |
For the SO question you linked to, it seems like closing the doctrine connection is better: http://stackoverflow.com/a/8518462/1149495 |
I saw that one too, and tried it before finding the "gc_collect_cycles()" solution, with the same result -> Too many connections. |
If I understand the linked answer correctly, they suggest to add both Given that some people are suffering these problems (I suffered them myself too) I think we should make a last effort to finish and merge these changes. Thanks. |
DoctrineBundle 1.4+ closes the connection already on shutdown. No need to do it manually in all your tests (and WebTestcase shutdowns the kernel on teardown) |
btw, I don't see why |
That's the point : there is no logic on that, I just had to do it to make it work, and obviously I'm not the only one who had this problem. |
btw, closing the entity manager is not necessary anymore either with DoctrineBundle 1.4+ as it also does it. So this article might be simplified. |
Actually, I have an idea why |
So, now symfony/symfony#15185 is merged, is this note still needed /cc @stof ? If so, can we - now we know why this might be needed - formalize a more explicit note (like "If you do/use XXX and get an 'too many connections' error in your tests, add |
@stof can you please tell me whether this is still relevant, now we have a resettable container in Symfony? |
Closing because of the lack of response and because nobody else seems to have this issue. Feel free to comment, there is a reopen button in GitHub :) |
Added a hint to properly close the connection depending on the PHP version.