Skip to content
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

DDC-3551: [GH-1294] Avoid Connection error when calling ClassMetadataFactor::getAllMetadata() #4369

Closed
doctrinebot opened this issue Jan 29, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of weaverryan:

Url: #1294

Message:

Hi guys!

When you pair the ORM with DBAL 2.5.0, then getting the targetPlatform means that a connection will be made to the database. For that reason, it's really important to not get the targetPlatform unless it's absolutely needed. Currently, if you call ClassMetadataFactor::getAllMetadata(), it will try to determine targetPlatform (in initialize()), which will make a connection. And if that connection fails (e.g. no db yet), it will blow up - even though getAllMetadata() doesn't need the targetPlatform.

This fixes that, and in an absolutely BC way, since targetPlatform is private (yay!). This should fix a number of issues in userland, like symfony/symfony-standard#748 and symfony/symfony-standard#774.

This is a PR to master (per the guidelines), but the real target is 2.4, since it's the latest stable. The patch won't apply cleanly, but it's simple: remove from initialize, then replace all references to the new private method.

Thanks in advance! More details are on the commit message.

@doctrinebot
Copy link
Author

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1294] was merged:
#1294

@doctrinebot
Copy link
Author

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1294] was assigned:
#1294

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.4.8 milestone Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants