Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 2.0.0-BETA4
-
Fix Version/s: None
-
Component/s: Drivers
-
Labels:None
-
Environment:Linux, PHP 5.3
Description
When there is a problem while connecting to an Oracle database and exception is being thrown, it leads to an improper call of oci_error() function, resulting in an error like this:
PHP Warning: oci_error() expects parameter 1 to be resource, boolean given in /var/www/mmasd/library/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php on line 106
[Doctrine\DBAL\Driver\OCI8\OCI8Exception]
It is because Doctrine feeds database connection resource to the function, but because connection was unsuccessful, resource is bool(false). Attached patch fixes this issue in my version of oci8, and it detects returning a string instead of an array from oci_error() function, just in case. Result after applying the patch:
[Doctrine\DBAL\Driver\OCI8\OCI8Exception]
ORA-12541: TNS:no listener
Activity
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Duplicate [ 3 ] |
| Workflow | jira [ 12134 ] | jira-feedback2 [ 17676 ] |
| Workflow | jira-feedback2 [ 17676 ] | jira-feedback3 [ 20031 ] |