Skip to content

Loading…

DBAL-66: No proper error message when exception thrown before Oracle DB is connected #1879

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user leafnode:

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:
{quote}
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]
{quote}
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:
{quote}
[Doctrine\DBAL\Driver\OCI8\OCI8Exception]
ORA-12541: TNS:no listener
{quote}

@doctrinebot

Comment created by @beberlei:

This was fixed in DBAL RC-1, expect it to be shipped with ORM RC1

@doctrinebot

Issue was closed with resolution "Duplicate"

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.