-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add "easy connect string" support for the Oci8Driver #2306
Comments
I'm not sure that we should support this out of the box ourselves. |
The problem I see here is that the feature request is more or less asking to be able to provide the complete connection string by hand. This is basically the same as asking for the ability of providing a complete PDO connection string. I doubt we should accept something like this for Oracle related drivers only as it looks weird then not having the ability for other drivers, too (and there will be requests about that I am sure). Telling that I am not sure if we should accept that for all drivers (which would be the only option then) as it feels error prone and we'd have to support arbitrary connection strings then... |
@deeky666 You're right, I want to provide the connection string by hand, but I do think it is a little different than from providing the PDO strings by hand. Actually, the default for Oracle is using these type of connect descriptors (or easy connect, they use both terms) in So, at the moment the default method for providing the connection info for Oracle DBs is not supported, although it is being used internally. PDO is the PHP solution for connecting to databases, which means that it is not the default for sharing the connections details. That way, there is a significant difference between the two. I will make a PR soon (it doesn't need that much change actually). |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am using the Oci8Driver currently with static connect information, such as host, port and dbname. These parameters are used in the AbstractOracleDriver#L114 class to generate an easy connect string, which is used to connect to the server/database.
However, I want to switch to LDAP resolving for the database host and port. The LDAP server already returns an easy connect string, which currently can not be used directly. I parse the string to retrieve the first mentioned hostname and port, which are set in the connection using a Symfony Compiler Pass (see the shortened snippet below).
This creates a problem when the first server does not have the database available: an error is thrown (in this case 'ORA-12505: TNS:listener does not currently know of SID given in connect descriptor') and there is no possibility to switch to the other database, although there is a connection list available during the Compiller Pass (but not during runtime).
I believe that when the connect string can be set in the driver, that handling of such database errors can be done by the lower driver (correct me if I'm wrong).
So, it would be convenient to be able to set the connect string directly, which can be used if set. I can make a PR for this if wanted. Any opinions?
P.S.: The link in AbstractOracleDriver#L112 is no longer valid, I can fix that as well.
The text was updated successfully, but these errors were encountered: