mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3475: Avoid db connection in constructor #4283
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jan 5, 2015).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user stefk:
Hi,
Since DBAL 2.5, calling *getDatabasePlatform* implies in most cases making a connection attempt (https://github.com/doctrine/dbal/blob/master/UPGRADE.md#bc-break-doctrinedbalconnection). Yet that method is called in the constructor of the SchemaTool class, which isn't very clean and can be problematic in some situations.
Are you open to a modification of that class to avoid this issue ? I can think of two workarounds :
I can send a PR if that's ok for you.
@doctrinebot commented on GitHub (Jan 5, 2015):
@doctrinebot commented on GitHub (Jan 5, 2015):
Comment created by @deeky666:
See DBAL-1057.
We still don't know how to properly fix that issue, whether we can do something to make the connection lazier in DBAL already or if we have to adjust ORM / DoctrineBundle and possible other projects to avoid issues.
Currently it looks like we can't do much in DBAL so I tend to say that the complete ORM code has to be scanned for early platform retrieval and fixed to avoid possible issues.
[ocramius] [beberlei] thoughts?
@doctrinebot commented on GitHub (Oct 9, 2015):
Comment created by tomasz.janiczek:
Is there any progress on this? This impacts a lot of projects...