Jira issue originally created by user digitalmechanic:
On line 56 of the file ./vendor/doctrine-dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php:
The line reads:
$dsn .= '))(CONNECTDATA=(SID=' . $params['dbname'] . ')))'; should read $dsn .= '))(CONNECT_DATA=(SERVICENAME=' . $params['dbname'] . ')))';
If both SID and SERVICE_NAME need to be available for use, then logic should be inserted to determine which method is being used.
Comment created by @beberlei:
Whats the difference? the Use of SID works for me.
Comment created by yourwebmaker:
There are some Oracle connections that are setup from SERVICE_NAME (without a SID).
In my company we always use SERVICE_NAME to setup a connection and we needed to modify the OCI connection driver from Doctrine to works fine in our environment
Take a look in: http://stackoverflow.com/questions/43866/how-sid-is-different-from-service-name-in-oracle-tnsnames-ora
Comment created by digitalmechanic:
There's a subtle difference between SID and SERVICE_NAME and I think the code should somehow account for the difference. Here's why... An SID points to a physical instance at the database level (Service Identifier). If you ask for a SID you only get one shot at the connection (and hopefully the database is up). That's the legacy method of connecting to Oracle.
However, for environments that have HA installations of Oracle using RAC, the SERVICENAME is what is used to point to a database instance (instead of a physical Service ID). If a given database instance is down and you're using SID - meaning you're looking to connect to a specific database, the connection fails. If you're in an environment with multiple instances of the target database, then RAC figures out where to send you if you're using SERVICENAME and you will land on an useable instance. This is the typical way to connect when Oracle is load-balanced and in a high-availability environment.
How can we solve this issue in a BC way? I wouldn't know if I can just change it the way suggested and it will work for everyone.
Fixed by adding a new parameter 'service' which has to be true to use SERVICE_NAME instead of SID.
Issue was closed with resolution "Fixed"