Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-66

No proper error message when exception thrown before Oracle DB is connected

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor 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

      1. doctrine.patch
        0.7 kB
        Leszek Krupiński

        Activity

        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - This was fixed in DBAL RC-1, expect it to be shipped with ORM RC1

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Leszek Krupiński
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: